...
Code Block | ||
---|---|---|
| ||
{ "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%" } } |
Parameters
Parameter | Required | Description |
---|---|---|
| Yes | Webhook configuration name |
| No | Webhook configuration description |
| Yes | Webhook type name from Supported resources and webhook types without |
| Yes | External API endpoint where doo sends the webhook payload for the specified webhook type. See Webhook request |
| Yes | GraphQL query which specifies the webhook payload structure. |
| Yes, if | External authorization OAuth API endpoint where doo can retrieve See Webhook request |
| Yes, if | A valid OAuth Client Secret pre-shared with doo. |
Example
Code Block | ||
---|---|---|
| ||
{ "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%" } } |