Subscribe to channel webhooks

Finally to receive webhooks for your newly created channel you should subscribe to channels webhooks as described in detail here. To subscribe to all events (message status, interactions, incoming messages) you can make the following requests using the channel id you just received.

Set up a webhook subscription

post
Path parameters
organization_idstringRequired

The ID of the organization

workspace_idstringRequired

The ID of the workspace

Body
servicestringOptional
eventstringOptional
templatestringOptional
urlstringOptional
signingKeystringOptional
Responses
200
Successful response
post
POST /organizations/{organization_id}/workspaces/{workspace_id}/webhook-subscription HTTP/1.1
Host: 
Content-Type: application/json
Accept: */*
Content-Length: 131

{
  "service": "text",
  "event": "text",
  "eventFilters": [
    {
      "key": "text",
      "value": "text"
    }
  ],
  "template": "text",
  "url": "text",
  "signingKey": "text"
}

No content

Replace {{webhook_url}} with an endpoint you will recieve webhooks and {{signing_key}} is a secret you can use to verify the webhook. Filter by {{channel_id}} to just get webhooks for this channel

curl --location 'https://api.bird.com/workspaces/<your-workspace-id>/numbers' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: AccessKey <your-access-key>' \
--data '{
  "service": "channels",
  "event": "whatsapp.inbound",
  "url": "{{webhook_url}}",
  "signingKey": "{{signing_key}}",
  "eventFilters": [
    {
      "key": "channelId",
      "value": "{{channelid}}"
    }
  ]
}'

Where next

Now you have completed the basics of onboarding you can begin sending and receiving messages to your channel. To get started:

Last updated

Was this helpful?