Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Common information

Webhooks configurations will be attached to an entire organization with all its events. The payload of event and order webhooks will contain the event_id so you can decide which webhooks to process.

Info

We do not give a confirmation on whether the webhook configuration has been deleted. This prevents brute-force attacks to know whether they have been successful.

List Webhook Configurations

Request

Curl
Code Block
languagebash
curl -X GET https://rest.doo.net/v1/team/<team_id>/webhooks \
-H 'Content-Type: application/json' \
-H 'x-api-key: <api_key>' \
-H 'Authorization: Bearer <access_token>'

Parameters

...

Parameter

...

Required

...

Description

...

<team_id>

...

Yes

...

Team ID for which you want to retrieve the webhook configurations, see Get all your organizations and teams 

...

<api_key>

...

Yes

...

see API Authorization

...

<access_token>

...

Yes

...

see API Authorization

Response

Response example 1

JSON
Code Block
languagejs
{
    "_links": {
        "self": {
            "href": "https://rest.doo.net/team/<team_id>/webhooks?page=1"
        },
        "first": {
            "href": "https://rest.doo.net/team/<team_id>/webhooks"
        },
        "last": {
            "href": "https://rest.doo.net/team/<team_id>/webhooks?page=1"
        }
    },
    "_embedded": {
        "webhooks": [
            {
                "id": "38cc7e8d-d107-11e7-bde8-0206116776d1",
                "name": "My Test Webhook",
                "description": "Webhook for testing all the hook types",
                "hooks": [
                    {
                        "type": "event_created",
                        "method": "POST",
                        "endpoint": "https://requestb.in/123"
                    },
                    {
                        "type": "event_removed",
                        "method": "POST",
                        "endpoint": "https://requestb.in/123"
                    },
                    {
                        "type": "event_updated",
                        "method": "POST",
                        "endpoint": "https://requestb.in/123"
                    },
                    {
                        "type": "order_created",
                        "method": "POST",
                        "endpoint": "https://requestb.in/123"
                    },
                    {
                        "type": "order_removed",
                        "method": "POST",
                        "endpoint": "https://requestb.in/123"
                    },
                    {
                        "type": "order_updated",
                        "method": "POST",
                        "endpoint": "https://requestb.in/123"
                    },
                    {
                        "type": "order_cancelled",
                        "method": "POST",
                        "endpoint": "https://requestb.in/123"
                    }
                ],
                "authentication": {
                    "grant_type": "client_credentials",
                    "endpoint": "https://requestb.in/123",
                    "credentials": {
                        "client_id": "doo",
                        "client_secret": "super-strong-secret"
                    },
                    "header_format": "Authorization",
                    "header_value_format": "Bearer %ACCESS_TOKEN%"
                },
                "_links": {
                    "self": {
                        "href": "https://rest.doo.net/v1/webhooks/38cc7e8d-d107-11e7-bde8-0206116776d1"
                    }
                }
            }
        ]
    },
    "page_count": 1,
    "page_size": 25,
    "total_items": 5,
    "page": 1
}

Response example 2

JSON
Code Block
languagejs
{
  "_links": {
    "self": {
      "href": "https://api.staging1.doo.net/v1/team/<team_id>/webhooks?page=1"
    },
    "first": {
      "href": "https://api.staging1.doo.net/v1/team/<team_id>/webhooks"
    },
    "last": {
      "href": "https://api.staging1.doo.net/v1/team/<team_id>/webhooks?page=1"
    }
  },
  "_embedded": {
    "webhooks": [
      {
        "id": "04266663-6684-a883-66b2-cfa3e7572d33",
        "name": "My GraphQL Webhook",
        "description": "Webhook for testing hook types with GraphQL body",
        "hooks": [
          {
            "type": "event_created_92bd9a53281981160c955e339304b3e5",
            "method": "POST",
            "endpoint": "https://requestb.in/123",
            "origin": {
              "method": "POST",
              "endpoint": "https://gql.doo.net",
              "body": "{\"operationName\":\"EventCreatedShort\",\"variables\":{\"id\":\"%EVENT_ID%\"},\"query\":\"query EventCreatedShort($id: ID!) {\\n event(id: $id) {\\n title\\n }\\n}\\n\"}"
            }
          },
          {
            "type": "event_updated_2104384af7e8434f0058ed57163b6f33",
            "method": "POST",
            "endpoint": "https://requestb.in/123",
            "origin": {
              "method": "POST",
              "endpoint": "https://gql.doo.net",
              "body": "{\"operationName\":\"EventUpdatedShort\",\"variables\":{\"id\":\"%EVENT_ID%\"},\"query\":\"query EventUpdatedShort($id: ID!) {\\n event(id: $id) {\\n title\\n }\\n}\\n\"}"
            }
          }
        ],
        "authentication": {
          "grant_type": "client_credentials",
          "endpoint": "https://requestb.in/123",
          "credentials": {
            "client_id": "doo",
            "client_secret": "super-strong-secret"
          },
          "header_format": "Authorization",
          "header_value_format": "Bearer %ACCESS_TOKEN%"
        },
        "_links": {
          "self": {
            "href": "https://api.staging1.doo.net/v1/team/<team_id>/webhooks"
          }
        }
      }
    ]
  },
  "page_count": 1,
  "page_size": 7,
  "total_items": 1,
  "page": 1
}

...

Request

Curl
Code Block
languagebash
curl -X Get https://rest.doo.net/v1/organizers/current/organizations \
-H 'Content-Type: application/json' \
-H 'x-api-key: <api_key>' \
-H 'Authorization: Bearer <access_token>'

Parameters

...

Parameter

...

Required

...

Description

...

<access_token>

...

Yes

...

see API Authorization

...

<api_key>

...

Yes

...

see API Authorization

Response

JSON

...

languagejs

...

With Webhook Management API, you can create, update and delete your webhook subscriptions and make some related operations.

On the sub-pages, you can find all the available API requests for webhook management.