Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 20 Next »

Object

{
  "name": "<name>",
  "description": "<description>",
  "hooks": [
    {
      "type": "event_created",
      "method": "POST",
      "origin":{
          "method":"POST",
          "endpoint":"https://<some url>",
          "body":"{<this is body as enclosed JSON string>}"
      },
      "endpoint": "<hook_endpoint>"
    }
  ],
  "authentication": {
    "grant_type": "client_credentials",
    "endpoint": "<oauth_endpoint>",
    "credentials": {
		"client_id": "<client_id>", 
    	"client_secret": "<client_secret>"
	},
    "header_format": "Authorization",
    "header_value_format": "Bearer %ACCESS_TOKEN%"
  }
}

Parameters

Parameter

Required

Description

<name>

Yes

Webhook configuration name

<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 

Example

{
    "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%"
    }
}
  • No labels