Custom Inbox Integration
Webhooks
You can refer to here for more details about webhooks.
Validation
All the webhook event would come with a signature ("X-Woztell-Signature") in the header for validation purposes. Each webhook event could be validated using the following method.
- Using the HMAC-SHA256 algorithm with the channel secret as the secret key, compute the digest for the request body.
- Confirm that the Base64-encoded digest matches the signature in the X-Woztell-Signature request header.
Inbound Messages
Normalized Inbound Messages
By subscribing to this webhook, your would receive the normalized events that WOZTELL pre-processed for all supported platforms.
Sample from WhatsApp
Text
{
"from": "85260903521",
"to": "85268227287",
"timestamp": "1599536864",
"type": "TEXT",
"data": {
"text": "Hello"
}
"member": "memberId",
"channel": "channeId",
"app": "appId",
"memberExtra": {
"name": "Man"
}
}
Video
{
"from": "85260903521",
"to": "85268227287",
"timestamp": "1599536864",
"type": "MISC",
"data": {
"attachments": [{
"type": "VIDEO",
"waMediaId": "e8a85916-2386-49dc-8f05-1cd0527bfb68",
}],
}
"member": "memberId",
"channel": "channeId",
"app": "appId",
"memberExtra": {
"name": "Man"
}
}
Outbound Messages
Bot Replied Messages
WOZTELL would send the messages sent by chatbot to your designated webhook.
Manual Messages
All the messages sent via WOZTELL sendResponse API would also send to your designated webhook as type MANUAL.
body
| Property | Type | Description |
|---|---|---|
| type | String | Can be either BOT, MANUAL or RELAY. Indicating whether the outbound message is from the chatbot or from API |
| member | String | ID of the member |
| channel | String | ID of the channel |
| app | String | ID of the app |
| memberExtra | Object | Extra member info that is only present if the inbound/outbound webhooks were added by an integration using Open API (Optional) |
| messageEvent | Object | messageEvent object container the normalised message |
messageEvent
| Property | Type | Description |
|---|---|---|
| from | String | ID of the sender |
| to | String | ID of the recipient |
| timestamp | Number | Unix timestamp |
| type | String | Message type* |
| data | Object | Message data for the corresponding message type* |
| messageId | String | Message ID from the external platform (this property might not exists) |
*Please refer to the official documentation for all the message types and the structure of the corresponding message data here.
Sample event
{
"type": "BOT",
"member": "memberId",
"channel": "channeId",
"app": "appId",
"memberExtra": {
"name": "Man"
},
"messageEvent": {
"from": "85260903521",
"to": "85268227287",
"timestamp": "1599536864",
"type": "TEXT",
"data": {
"text": "Hello"
}
}
}
Deauthorize
When user remove the the Inbox Solution integration from his WOZTELL app, an event would be send to the designated webhook URL.
Sample Event
{
"account": "account-id",
"timestamp": 1599527673000
}