Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
{
    "name": "<webhook_configuration_name>",
    "description": "<webhook_configuration_description>",
    "hooks": [
        {
            "type": "<webhook_type>",
            "method": "POST",
            "endpoint": "<external_endpoint_url>",
            "origin": {
                "method": "POST",
                "endpoint": "https://gql.doo.net",
                "body": "<graphql_query>"
            }
        }
    ],
    "authentication": {
        "grant_type": "client_credentials",
        "endpoint": "<external_oauth_endpoint_url>",
        "credentials": {
            "client_id": "doo",
            "client_secret": "<external_client_secret>"
        },
        "header_format": "Authorization",
        "header_value_format": "Bearer %ACCESS_TOKEN%"
    }
}

If the <external_endpoint_url> is not protected with OAuth, you can omit the authentication object in the configuration object. In this case, doo will send the webhook request without access_token. See Webhook request for more information.

Parameters

Parameter

Required

Description

<webhook_configuration_name>

Yes

Webhook configuration name

<webhook_configuration_description>

No

Webhook configuration description

<webhook_type>

Yes

Webhook type name from Supported resources and webhook types without on_ preffix.

<external_endpoint_url>

Yes

External API endpoint where doo sends the webhook payload for the specified webhook type.

See Webhook request

<graphql_query>

Yes

GraphQL query which specifies the webhook payload structure.

See How to prepare GraphQL query for webhook configuration?

<external_oauth_endpoint_url>

Yes, if authentication object does exist in the configuration object

External authorization OAuth API endpoint where doo can retrieve access_token.

See Webhook request

<external_client_secret>

Yes, if authentication object does exist in the configuration object

A valid OAuth Client Secret pre-shared with doo.

...