Connectly Documentation
  • ๐Ÿ‘‹Welcome to Connectly.ai
  • ๐Ÿš€Quick Start
    • Prerequisites
    • Authentication
    • Send WhatsApp template message
    • Send WhatsApp session message
  • ๐Ÿ“ฃCampaigns
    • Campaign Sendout
      • Send Campaigns
  • ๐Ÿค–Sofia AI
    • How to use Sofia AI?
    • Sofia AI API
      • Reference
        • Core Concepts
        • sales_assistant_v2/invoke/v1
  • ๐Ÿ“ฑMessage API
    • Message Service API
      • MessageService
        • Send template message
        • Send session message
      • Error codes
    • Webhook API
      • WebhookService
        • Create a webhook registration by event topic
        • Update an existing webhook registration by event topic
        • Get webhook registrations for business
        • Delete a webhook registration for business
      • Webhook Payload
        • Delivery Status Error Codes
        • Payload Media Types
  • ๐Ÿค–Business Management
    • Business Management API
      • Template Management
        • Create a template
        • Get templates
      • Quality Signals
  • ๐Ÿ“ฑIntegrations
    • Integrations
      • WebEngage Integration
      • Message your customers on Zendesk through Connectly
      • Message your customer on Intercom through Connectly
    • [Alpha] Moengage
      • MessageService
        • Send Campaign via API
  • ๐Ÿ“ŠAnalytics
    • Analytics
      • [Alpha] Campaign report
      • Reports API
        • Webhooks configuration
  • ๐Ÿ‘€FAQ
  • Migrating WhatsApp Accounts
  • How to use time delay?
Powered by GitBook
On this page
  1. Message API
  2. Webhook API
  3. WebhookService

Create a webhook registration by event topic

PreviousWebhookServiceNextUpdate an existing webhook registration by event topic

Last updated 2 months ago

Register your endpoint to receive Connectly webhook events

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

๐Ÿ“ฑ
  • Register your endpoint to receive Connectly webhook events
  • POST/v1/businesses/{businessId}/create/webhooks
  • Examples
  • Available topics
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
201
Successful response containing details of created webhook subscription.
application/json
default
An unexpected error 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"
}