This repository has been archived by the owner on Aug 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Message payload
Jasmine Anteunis edited this page Jan 15, 2019
·
3 revisions
This page contains the different payloads you can send to the /converse endpoint.
If you want more details on the API here.
Button's types are similar to those of Messenger, you can set one of the following:
- postback: basic type, send the value of the button as a message when clicked
- web_url: open the link contained in the value field in a new window
- phone_number: supported by some channels, call the phone number contained in the value field
Here's the list of the different payloads you can send. Every payloads work with every channel, even if a carousel will look better on a channel like Messenger than on a SMS-based channel like Twilio or Callr.
{
type: 'text',
content: 'MY_TEXT',
}
{
type: 'picture',
content: 'IMAGE_URL',
}
{
type: 'video',
content: 'VIDEO_URL',
}
{
type: 'quickReplies',
content: {
title: 'TITLE',
buttons: [
{
title: 'BUTTON_1_TITLE',
value: 'BUTTON_1_VALUE',
}, {
title: 'BUTTON_2_TITLE',
value: 'BUTTON_2_VALUE',
}
]
}
}
{
type: 'list',
content: {
elements: [
{
title: 'ELEM_1_TITLE',
imageUrl: 'IMAGE_URL',
subtitle: 'ELEM_1_SUBTITLE',
buttons: [
{
title: 'BUTTON_1_TITLE',
value: 'BUTTON_1_VALUE',
type: 'BUTTON_TYPE',
}
]
}
],
buttons: [
{
title: 'BUTTON_1_TITLE',
value: 'BUTTON_1_VALUE',
type: 'BUTTON_TYPE',
}
]
}
}
{
type: 'card',
content: {
title: 'CARD_TITLE',
subtitle: 'CARD_SUBTITLE',
imageUrl: 'IMAGE_URL',
buttons: [
{
title: 'BUTTON_TITLE',
type: 'BUTTON_TYPE', // See Facebook Messenger button formats
value: 'BUTTON_VALUE',
}
],
},
}
{
type: 'carousel',
content: [
{
title: 'CARD_1_TITLE',
imageUrl: 'IMAGE_URL',
buttons: [
{
title: 'BUTTON_1_TITLE',
value: 'BUTTON_1_VALUE',
type: 'BUTTON_1_TYPE',
}
]
}
],
}