Send a message or postback

Send a message to the chatbot. The message may be:

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:

  • "restart": true to start the default entry point passage.
  • "entryPoint": "entryPointId" to start another entry point passage.
  • nextPassage object with a passage ID of a specific passage to start.
    You can list actions to perform before starting the passage in an inlineActions array. This array is optional.

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:

  1. Click Create in the left navigation, then click Conversations.
  2. Click the conversation with the passage you want.
  3. 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.
Was this article helpful?
0 out of 0 found this helpful