Versions Compared

Key

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

...

Configuration object

Code Block
languagejs
{
    "name": "<name><webhook_configuration_name>",
    "description": "<description><webhook_configuration_description>",
    "hooks": [
        {
            "type": "event<webhook_createdtype>",
            "method": "POST",
            "endpoint": "<external_endpoint_url>",
            "origin": {
                "method": "POST",
                "endpoint": "https://<some url>gql.doo.net",
                "body":"{<this is body as enclosed JSON string>}" "<graphql_query>"
            },
      "endpoint": "<hook_endpoint>" }
   } ],
 ],   "authentication": {
        "grant_type": "client_credentials",
        "endpoint": "<oauth_endpoint><external_oauth_endpoint_url>",
        "credentials": {
		
            "client_id": "<client_id>doo",
     	       "client_secret": "<client<external_client_secret>"
	
        },
        "header_format": "Authorization",
        "header_value_format": "Bearer %ACCESS_TOKEN%"
    }
}

Parameters

Parameter

Required

Description

<name><webhook_configuration_name>

Yes

Webhook configuration name<description>

<webhook_configuration_description>

No

Webhook configuration detailed description

<hook_endpoint>

Yes

Your server URL where you want to receive the webhook

Can be separate for each hook type

<oauth_endpoint>

Yes

Your server OAuth endpoint URL

<client_id>

No

Client Id for your OAuth endpoint 

<client_secret>

No

Client Secret for your OAuth endpoint 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.

Example

Code Block
languagejs
{
    "name": "Test webhook",
    "description": "Event creation and updates webhook subscription",
    "hooks": [
        {
            "type": "event_created",
            "method": "POST",
            "endpoint": "https://company.com/receive-doo-webhooks",
            "origin": {
                "method": "POST",
                "endpoint": "https://gql.doo.net",
                "body": "{\"operationName\":null,\"variables\":{\"eventId\":\"%EVENT_ID%\"},\"query\":\"query ($eventId: ID!) {event(id: $eventId) { id title }}\"}"
            }
        },
        {
            "type": "event_updated",
            "method": "POST",
            "endpoint": "https://company.com/receive-doo-webhooks",
            "origin": {
                "method": "POST",
                "endpoint": "https://gql.doo.net",
                "body": "{\"operationName\":null,\"variables\":{\"eventId\":\"%EVENT_ID%\"},\"query\":\"query ($eventId: ID!) {event(id: $eventId) { id title }}\"}"
            }
        }
    ],
    "authentication": {
        "grant_type": "client_credentials",
        "endpoint": "https://company.com/authorize-doo-webhooks",
        "credentials": {
            "client_id": "doo",
            "client_secret": "super-strong-secret"
        },
        "header_format": "Authorization",
        "header_value_format": "Bearer %ACCESS_TOKEN%"
    }
}