Send a message to the chatbot. The message may be:
- The text of the chatbot user's response.
- A postback to start the default entry point passage, the passage of another entry point, or a specific passage.
- An acknowledgement of a message you've received from the chatbot.
Request
The webhook integration page contains the base URL to use for all webhook endpoints and the access token to include as a Bearer token in all requests.
| Endpoint | POST | {baseURL}/conversations/{conversationId}/messages |
| Headers | Content-Type | application/json |
| Authorization | Bearer {AccessToken} | |
| Path parameters | conversationID | The chat identifier that was returned when you initiated the chat. |
| Body |
JSON object of either:
|
Text message from chatbot user
Send a text response from the chatbot user.
| Property | Value |
|---|---|
| author.type | "user" |
| content.type | "text" |
| content.text | The text message to send. |
{
"author": {
"type": "user"
},
"content": {
"type": "text",
"text": "how do I reset my password"
}
}Postback to start a passage
Send a postback to start a specific passage. You can start:
- The passage of the default entry point.
- The passage of another entry point.
- Another passage you specify.
| Property | Value |
|---|---|
| author.type | "user" |
| content.type | "postback" |
| content.payload |
Object containing one of:
If you want to start a specific entry point or passage, you will need the entry point or passage ID. See Passage and entry point IDs. |
{
"author": {
"type": "user"
},
"content": {
"type": "postback",
"payload": {
"nextPassage": {
"passageId": "xxxxxxxx",
"inlineActions": []
}
}
}
}Passage and entry point IDs
To find the ID of an entry point:
- Click Manage in the left navigation, then click Entry Points.
- Click the menu of the entry point you want, then click Copy Entry Point ID.
To find the ID of a passage:
- Click Create in the left navigation, then click Conversations.
- Click the conversation with the passage you want.
- Click the menu of the passage you want, then click Copy Passage ID.
Acknowledge chatbot message
Acknowledge a message from the chatbot by sending the message property of the request with an additional property of "is_echo".
| Property | Value |
|---|---|
| message | The message property of the message request you received. |
| message.is_echo | true |
"message": {
"is_echo": true,
"id": "xxxxxxxxx",
"author": {
"type": "chatbot"
},
"content": {
"type": "text",
"text": "I am a helpful chatbot! What can I help you with today?",
},
}Response
| Response code | Description |
|---|---|
| 200 |
Acknowledged. An empty JSON object is returned to acknowledge the request. Requests that result in issues such as for invalid passages or entry points still return the acknowledgement and empty object. |
| 400 | Error. Common causes of errors include a malformed or missing content or message payload, an incomplete webhook integration, incorrect or missing authorization headers, or invalid chatbot or team ID in the base URL. |