Message formats
Structure
{
"type": 1, // 1: Simple text message, 7: Carousel message
"text": "user, bot or an application's message", // this field is set when "type" is equal to 1
"items": [ // caroussel items, this field is set when "type" is equal to 7
{
"title": "Caroussel Item",
"size": 0,
"mediaType": "picture",
"mediaUrl": "https://example.com/path/to/my/picture.jpg",
"description": "", // Item price
"actions": [
{
"type": 2, // 2: Link (You must display a button containing the `text` field content and When clicked you redirect the customer to the provided link in the `uri` field), 4: Reply (You must display the `text` field to the user and when the user choose this action, the api must send the `payload` content as a message)
"text": "Action's text",
"uri": "https://example.com/path/to/my/url?foo=bar#test"
}
],
"stars": 5 // optional
}
],
"actions": [ // optional
{
"type": 4, // 4: Reply (You must display the `text` field to the user and when the user choose this action, the api must send the `payload` content as a message), 2: Link (You must display a button containing the `text` field content and When clicked you redirect the customer to the provided link in the `uri` field)
"text": "Contact us",
"payload": "Contact staff"
}
]
}
Content field types
Simple Text: The message you've received is a text message and it's content will be in
textfield, so the body will look like{ "conversation_id": 123, "content": { "type": 1, "text": "user, bot or an application's message", "actions": [] // optional } }Carousel: This represents a carousel message, the carousel items will be in
itemsfield, so the body will look like{ "conversation_id": 123, "content": { "type": 7, "items": [ { "title": "Caroussel Item", "size": 0, "mediaType": "picture", "mediaUrl": "https://example.com/path/to/my/picture.jpg", "description": "", "actions": [] } ], "actions": [] // optional } }
actions field types
Link: This action represents a link to external URL, it contains the
textto display on the link button and theurito redirect to, ex:{ "type": 2, "text": "Action's text", "uri": "https://example.com/path/to/my/url?foo=bar#test" }Reply: This action represents a reply suggestion in order to help the user writing responses, the content of
textfield supposed to be displayed to the user and thepayload's content is supposed to be sent as a response when the user clicks on the button. the action format will look like:{ "type": 4, "text": "Contact us", "payload": "Contact staff" }