Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

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.

Payloads

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.

Text

{
  type: 'text',
  content: 'MY_TEXT',
}

Picture

{
  type: 'picture',
  content: 'IMAGE_URL',
}

Video

{
  type: 'video',
  content: 'VIDEO_URL',
}

Quick Replies

{
  type: 'quickReplies',
  content: {
    title: 'TITLE',
    buttons: [
      {
        title: 'BUTTON_1_TITLE',
        value: 'BUTTON_1_VALUE',
      }, {
        title: 'BUTTON_2_TITLE',
        value: 'BUTTON_2_VALUE',
      }
    ]
  }
}

List

{
  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',
      }
    ]
  }
}

Card

{
  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',
      }
    ],
  },
}

Carousel

{
  type: 'carousel',
  content: [
    {
      title: 'CARD_1_TITLE',
      imageUrl: 'IMAGE_URL',
      buttons: [
        {
          title: 'BUTTON_1_TITLE',
          value: 'BUTTON_1_VALUE',
          type: 'BUTTON_1_TYPE', 
        }  
      ]
    }
  ],
}
Clone this wiki locally