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 36
Message payload
Jasmine Anteunis edited this page Jan 15, 2019
·
4 revisions
This page references all the messages formats you can send with the Connect API.
Buttons can either be:
- postback: the basic type, once the button is tapped, the value is sent as a payload incoming message.
- web_url: when this button is tapped, the Url in the value field is loaded.
- phone_number: when this button is tapped, the phone number in the value field is called
You can find more information here.
Here's the list of the different payloads you can send. Every payloads work with every channels, 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',
}
]
}
],
}