Conversation API (Webhooks)
Integrating the Conversation API via Custom adapter provides most flexibility for automatic message responses.
It is expected from a customer to develop a single webhook endpoint available at a public URL. This endpoint should understand our payloads. The endpoint will receive all inbound messages as requests and it should respond in the specific format to those requests, which will be processed and forwarded to the end users as automatic message responses.
Please note that even though we use common payload format, each channel has its own characteristics, features and limitations. Please find details in the Channels Features section. When responding, you can either use common denominator of features across all expected channels, or customize your response based on the specific channel of the current request.
Request body object example
{
"serviceUuid": "d354fe67-87f2-4438-959f-65fde4622040",
"dialogUuid": "237a9b91-f7dd-4a49-939d-af95820d84a0",
"channel": "telegram",
"message": {
"from": "1014279770",
"providerMsgID": "497",
"allowedChannels": [
"telegram"
],
"body": {
"textMessage": {
"content": "Hello"
}
}
},
"contact": {
"uuid": "ae77ee16-1f77-4617-a5f0-c17b5483b730",
"mobile": "+4163456568",
"first_name": "John",
"last_name": "Smith",
"language": "en",
"birthday": "1991-09-24",
"channel_identifiers": "1014279770,+4163456568",
"channel_names": "telegram,whatsapp",
"channel_opt_statuses": "in,in",
"created_dt": "2023-01-04T15:07:09Z",
"opt_status": "in",
"status": "active"
}
}
Expected Response Example
Your endpoint is expected to respond to the webhook request with a list of messages if you intend to reply. This is a response payload example which will return 2 messages: a text and a picture message.
{
"messages": [
{
"body": {
"textMessage": {
"content": "Hello"
}
}
},
{
"body": {
"pictureMessage": {
"url": "https://www.apple.com/v/macbook-air/s/images/overview/design/lifestyle-gallery/design_portability_1__gfw34rh367u6_large.jpg",
"name": "MacBook Air"
}
}
}
]
}