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 · 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 field

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

Payloads

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.

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