The chatbot sends events, messages, and handover requests to the URL specified in your webhook integration. You must acknowledge each message request either via a delivery acknowledgement or an echo message before the chatbot will send the next message. Typing activity and handover events do not need to be acknowledged.
All requests follow the basic request payload and include additional properties specific to that event, message, or handover request:
- Typing indicator event
- Handover request to hand the chatbot user over to a livechat agent.
- Messages:
Messages may also include Quick Replies in the payload.
Conversation ID
Each webhook chat has a unique identifier so you can maintain multiple chats from the same integration or pick up where a previous chat left off. For compatibility with other platforms such as Sunshine Conversations, this identifier is called the conversation ID. When working with the webhook API, the conversation ID identifies a specific chat between your chatbot and the webhook integration, not a conversation in the inGenious AI platform.
Request payload
| Property | Description |
|---|---|
| app.teamId | The chatbot's team ID, available in general settings. |
| app.botId | The chatbot ID, available in general settings. |
| webhook.id | The id for this webhook integration, available in the webhook integration page. |
| webhook.version | The version of the webhook request payload sent in the request. The current version is v1. |
| events |
An array of event objects. Each object in the array contains:
|
{
"app": {
"teamId": "xxxxxxxx",
"botId": "xxxxxxxxx"
},
"webhook": {
"id": "xxxxxxxxxx",
"version": "v1"
},
"events": [
{
"id": "event_id",
"timestamp": 1458692752478,
"type": "{eventType}",
"payload": {
"conversation": {
"id": "{conversationId}"
},
{eventSpecificPayload}
}
}
]
}Typing indicator
The typing indicator event is sent when the chatbot starts or stops typing. You don't need to acknowledge a typing event.
| Property | Description |
|---|---|
| payload.activity.type |
The type of activity as a string. Activities include:
|
| payload.activity.author.type | The author of type "chatbot". |
{
"app": {
"teamId": "xxxxxxxx",
"botId": "xxxxxxxxx"
},
"webhook": {
"id": "xxxxxxxxxx",
"version": "v1"
},
"events": [
{
"id": "event_id",
"timestamp": 1458692752478,
"type": "conversation:typing",
"payload": {
"conversation": {
"id": "{conversationId}"
},
"activity":{
"type":"typing:start",
"author":{
"type": "chatbot"
}
}
}
}
]
}Handover request
The chatbot sent a request to hand the chatbot user over to a livechat agent. You don't need to acknowledge a handover request. The chatbot will not process or respond to further messages from your webhook until you send a handback request.
| Property | Description |
|---|---|
| payload.handover.metadata | An object containing any additional metadata for the handover. |
{
"app": {
"teamId": "xxxxxxxx",
"botId": "xxxxxxxxx"
},
"webhook": {
"id": "xxxxxxxxxx",
"version": "v1"
},
"events": [
{
"id": "event_id",
"timestamp": 1458692752478,
"type": "conversation:handover",
"payload": {
"conversation": {
"id": "{conversationId}"
},
"handover": {
"metadata" : {}
}
}
}
]
}Messages
All messages include a message property in the payload property. Include this message property in your delivery requestor message echo request to acknowledge the message.
Text message
The chatbot sent a text bubble. You must acknowledge this message.
| Property | Description |
|---|---|
| payload.message.id | The unique identifier of the message. |
| payload.message.author.type | The author of type "chatbot". |
| payload.message.content.type | The content of type "text". |
| payload.message.content.text | The text of the message. |
| payload.message.content.replies | An array of Quick Replies, if included. |
| payload.message.metadata | Any additional metadata included with the message such as Tags. |
{
"app": {
"teamId": "xxxxxxxx",
"botId": "xxxxxxxxx"
},
"webhook": {
"id": "xxxxxxxxxx",
"version": "v1"
},
"events": [
{
"id": "event_id",
"timestamp": 1458692752478,
"type": "conversation:message",
"payload": {
"conversation": {
"id": "{conversationId}"
},
"message ":{
"id":"xxxxxxxx",
"author":{
"type": "chatbot"
},
"content" : {
"type":"text",
"text":"I am a friendly chatbot!"
},
"metadata" : {}
}
}
}
]
}Image message
The chatbot sent an image. You must acknowledge this message.
| Property | Description |
|---|---|
| payload.message.id | The unique identifier of the message. |
| payload.message.author.type | The author of type "chatbot". |
| payload.message.content.type | The content of type "image". |
| payload.message.content.mediaUrl | The URL of the image. |
| payload.message.content.replies | An array of Quick Replies, if included. |
| payload.message.metadata | Any additional metadata included with the message such as Tags. |
{
"app": {
"teamId": "xxxxxxxx",
"botId": "xxxxxxxxx"
},
"webhook": {
"id": "xxxxxxxxxx",
"version": "v1"
},
"events": [
{
"id": "event_id",
"timestamp": 1458692752478,
"type": "conversation:message",
"payload": {
"conversation": {
"id": "{conversationId}"
},
"message ":{
"id":"xxxxxxxx",
"author":{
"type": "chatbot"
},
"content" : {
"type":"image",
"mediaUrl":"https://media.au.ingenious.ai/exampleImage.jpg"
},
"metadata" : {}
}
}
}
]
}Button message
The chatbot sent one or more buttons. You must acknowledge this message.
| Property | Description |
|---|---|
| payload.message.id | The unique identifier of the message. |
| payload.message.author.type | The author of type "chatbot". |
| payload.message.content.type | The content of type "button". |
| payload.message.content.text | The text message included with the buttons. |
| payload.message.content.buttons |
An array of button objects. Each object contains:
|
| payload.message.content.replies | An array of Quick Replies, if included. |
| payload.message.metadata | Any additional metadata included with the message such as Tags. |
Button types
| Button type | Used for | Additional Properties | Description |
|---|---|---|---|
| link |
|
url |
Specify the URL of the:
|
| postback | Start a passage | payload | The postback to start a passage. If the chatbot user presses this button, use this payload the same as you would for Quick Replies. |
| webview | Open a webview | url |
The webview URL to open (including access token). The format of this URL is: Your team and chatbot ID is available in general settings, and the webview ID is available from the webview menu. |
| fallback | An alternate webview to open (including access token) | ||
| size | The size to display the webview in the chat window, as per webview button. |
{
"app": {
"teamId": "xxxxxxxx",
"botId": "xxxxxxxxx"
},
"webhook": {
"id": "xxxxxxxxxx",
"version": "v1"
},
"events": [
{
"id": "event_id",
"timestamp": 1458692752478,
"type": "conversation:message",
"payload": {
"conversation": {
"id": "{conversationId}"
},
"message ":{
"id":"xxxxxxxx",
"author":{
"type": "chatbot"
},
"content" : {
"type":"button",
"text":"Please choose an option:",
"buttons": [
{
"text": "Open website",
"type": "link",
"url": "https://example.org"
},
{
"text": "Keep chatting",
"type": "postback",
"payload": {
"nextPassage": {
"passageId": "xxxxxxxx",
"inlineActions": []
}
}
},
{
"type": "link",
"text": "Call me!",
"url": "tel:+61404040404"
},
{
"type": "link",
"text": "Send an email",
"url": "mailto:test@email.com?cc=test2@email.com&bcc=test3@email.com&subject=Hello!&body=Hi"
},
{
"type": "webview",
"text": "Open a webview",
"url": "https://au.api.ingenious.ai/webview/v1/{teamId}/{botId}/{webviewId}?accessToken={token}",
"fallback": "https://au.api.ingenious.ai/webview/v1/{teamId}/{botId}/{webviewId}?accessToken={token}",
"size": "full"
}
]
},
"metadata" : {}
}
}
}
]
}Carousel message
The chatbot sent a carousel with one or more carousel items. You must acknowledge this message.
| Property | Description |
|---|---|
| payload.message.id | The unique identifier of the message. |
| payload.message.author.type | The author of type "chatbot". |
| payload.message.content.type | The content of type "carousel". |
| payload.message.content.items |
An array of carousel cards. Each card is an object containing:
|
| payload.message.content.replies | An array of Quick Replies, if included. |
| payload.message.metadata | Any additional metadata included with the message such as Tags. |
{
"app": {
"teamId": "xxxxxxxx",
"botId": "xxxxxxxxx"
},
"webhook": {
"id": "xxxxxxxxxx",
"version": "v1"
},
"events": [
{
"id": "event_id",
"timestamp": 1458692752478,
"type": "conversation:message",
"payload": {
"conversation": {
"id": "{conversationId}"
},
"message ":{
"id":"xxxxxxxx",
"author":{
"type": "chatbot"
},
"content" : {
"type":"carousel",
"items": [
{
"title":"Carousel Item 1",
"subtitle":"Item 1 subtltle",
"imageUrl": "https://example.org/image1.png",
"buttons": [
{
"text": "Open website",
"type": "link",
"url": "https://example.org"
},
{
"text": "Keep chatting",
"type": "postback",
"payload": {
"nextPassage": {
"passageId": "xxxxxxxx",
"inlineActions": []
}
}
},
]
},
{
"title":"Carousel Item 2",
"subtitle":"Item 2 subtltle",
"imageURL": "https://example.org/image2.png"
"buttons": [
{
"text": "Keep chatting",
"type": "postback",
"payload": {
"nextPassage": {
"passageId": "xxxxxxxx",
"inlineActions": []
}
}
},
]
}
]
},
"metadata" : {}
}
}
}
]
}Quick Replies
All message types may include an array of Quick Replies in the message content property.
To send a response that the chatbot user pressed a Quick Reply, send a postback request with the Quick Reply payload.
| Property | Description |
|---|---|
| "type" | The type of "postback". |
| "text" | The text to display in the Quick Reply button. |
| "payload" | The payload of the passage to start and any actions to perform. |
{
"app": {
"teamId": "xxxxxxxx",
"botId": "xxxxxxxxx"
},
"webhook": {
"id": "xxxxxxxxxx",
"version": "v1"
},
"events": [
{
"id": "event_id",
"timestamp": 1458692752478,
"type": "conversation:message",
"payload": {
"conversation": {
"id": "{conversationId}"
},
"message ":{
"id":"xxxxxxxx",
"author":{
"type": "chatbot"
},
"content" : {
"type":"text",
"text":"What's your favourite colour?",
"replies":[
{
"type":"postback",
"text":"Green",
"payload": {
"nextPassage": {
"passageId": "zzzzzzzz",
"inlineActions": []
}
}
},
{
"type":"postback",
"text":"Blue",
"payload": {
"nextPassage": {
"passageId": "xxxxxxxx",
"inlineActions": []
}
}
}
]
},
"metadata" : {}
}
}
}
]
}