Create a webhook registration by event topic

Register your endpoint to receive Connectly webhook events

post

API to create a new webhook registration by event topic

Authorizations
Path parameters
businessIdstringRequired
Body
topicstring · enumOptional

Topic is an enum for data topic a business can register webhooks for to receive updates for registered topic(s).

Default: topic_unspecifiedPossible values:
addressstringOptional
typestring · enumOptionalDefault: webhook_type_unspecifiedPossible values:
Responses
200
A successful response.
application/json
post
POST /v1/businesses/{businessId}/create/webhooks HTTP/1.1
Host: 
X-API-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 282

{
  "topic": "topic_unspecified",
  "address": "text",
  "type": "webhook_type_unspecified",
  "configuration": {
    "echo": true,
    "channelTypes": [
      "sms"
    ],
    "webengageConfiguration": {
      "webengageToken": "text",
      "webengageWebhookUrl": "text"
    },
    "filters": [
      {
        "field": "campaign_name",
        "expression": "test-campaign-*"
      }
    ]
  }
}
{
  "id": "text"
}

You can provide your endpoint to receive Connectly webhook events. When creating an endpoint you need to provide the following:

  1. your endpoint address

  2. webhook topic you are interested to receive events from

You can only register one endpoint address per each webhook topic.

Examples

To register your endpoint to receive client messages, you can send a post request to the above URL with:

{
    "topic":"messages",
    "address":"<YOUR_ENDPOINT>"
}

Later when clients message back, you will receive a payload similar to the following:

{u'sender': {u'channelType': u'whatsapp', u'id': u'+12223334444', u'name': u'Tom'}, u'timestamp': u'1661301940', u'buttonResponse': {u'text': u'Yes I'm interested', u'id': u'01GB6MZR50BY04MDAQH6TVYN40', u'payload': u'1'}, u'topic': u'messages', u'recipient': {u'channelType': u'whatsapp', u'id': u'+15556667777', u'name': u'Business'}, u'metadata': None}

Available topics

Topic
Description

messages

Subscribes you to receive WhatsApp messages from your clients {"timestamp":"1640203838", "sender":{"id":"+16044441111", "channelType":"whatsapp"}, "recipient":{"id":"+16041112222", "channelType":"whatsapp"}, "message":{"text":"hello"}}

delivery_status

Subscribes you to receive WhatsApp delivery status updates. These events tell you the transmission status of your message: - delivered - read - delivery_failed

Last updated