Skip to main content

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.

  1. Using the HMAC-SHA256 algorithm with the channel secret as the secret key, compute the digest for the request body.
  2. 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
PropertyTypeDescription
typeStringCan be either BOT, MANUAL or RELAY. Indicating whether the outbound message is from the chatbot or from API
memberStringID of the member
channelStringID of the channel
appStringID of the app
memberExtraObjectExtra member info that is only present if the inbound/outbound webhooks were added by an integration using Open API (Optional)
messageEventObjectmessageEvent object container the normalised message
messageEvent
PropertyTypeDescription
fromStringID of the sender
toStringID of the recipient
timestampNumberUnix timestamp
typeStringMessage type*
dataObjectMessage data for the corresponding message type*
messageIdStringMessage 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
}