Last updated: 03 March 2022

You can use templating to dynamically create any of our message types. In this doc, we cover the values each of our button and message types needs to contain to work appropriately.

type always takes the value of the template you are building. For example, to build a standard message, you will enter "Type": "Standard", for a carousel, "Type": "Carousel", etc.

Button types

To start, familiarise yourself with the different types of buttons you can append to various message types.

Button type

Template

Values

Postback

"responses": [
        {"type": "postback", 
          "label": "", 
          "action": ""}
      ]
CODE

  • type: has to equal postback.

  • label: text string, up to 255 characters.

  • action: text string, up to 255 characters.

Mailto

"responses": [
        {"type": "mailto", 
          "label": "", 
          "action": "",
          "linkback": ""}
      ]
CODE
  • type: has to equal mailto.

  • label: text string, up to 255 characters.

  • action: email address, text string, up to 255 characters.

  • linkback: text string, up to 255 characters.

Callto

"responses": [
        {"type": "callto", 
          "label": "", 
          "action": "",
          "linkback": ""}
      ]
CODE
  • type: has to equal callto.

  • label: text string, up to 255 characters.

  • action: phone number, text string, up to 255 characters.

  • linkback: text string, up to 255 characters.

URL

"responses": [
        {"type": "url", 
          "label": "", 
          "action": "",
          "linkback": ""}
      ]
CODE
  • type: has to equal url.

  • label: text string, up to 255 characters.

  • action: URL, text string, up to 255 characters.

  • linkback: text string, up to 255 characters.

File

"responses": [
        {"type": "file", 
          "label": "", 
          "action": "",
          "linkback": ""}
      ]
CODE
  • type: has to equal file.

  • label: text string, up to 255 characters.

  • action: text string, up to 255 characters.

  • linkback: text string, up to 255 characters.

Message types

Now, explore each message type and the value they take (including buttons).

Message type

Template

Values

Standard

{
    "type": "standard",
    "content": {
      "text": "hello"
    }
}
CODE
  • text: text string, up to 255 characters.

Action

{
    "type": "action",
    "content": {
      "text": "",
      "responses": [
        {
            "type": "", 
            "label": "", 
            "action": ""
        }
      ]
    }
}
CODE
  • text: text string, up to 255 characters.

  • responses: array, minimum 1, maximum 10.

  • responses (buttons): any button.

Carousel

{
    "type": "carousel",
    "content": {
      "items": [
        {
          "title": "",
          "subtitle": "",
          "image": 'http://placehold.it/400x200',
          "image_description": "",
          "url": "",
          "responses": [
            {
            "type": "", 
            "label": "", 
            "action": ""
            }
          ]
        }
      ],
    }
}
CODE
  • items: array, minimum 2, maximum 10.

  • title: text string, up to 255 characters.

  • subtitle: text string, up to 255 characters.

  • url: text string of a valid URL, up to 255 characters.

  • image: text string of a valid URL, up to 255 characters.

  • image_description: text string, up to 255 characters.

  • responses: array, minimum 1, maximum 10.

  • responses (buttons): any button.

Content

{
    "type": "content",
    "content": {
      "text": "",
      "title": "",
      "markdown": ""
    }
}
CODE
  • text: text string, up to 255 characters.

  • title: text string, up to 255 characters.

  • markdown: text string, up to 255 characters.

Embed

{
    "type": "content",
    "content": {
      "text": "",
      "title": "",
      "url": ""
    }
}
CODE
  • text: text string, up to 255 characters.

  • title: text string, up to 255 characters.

  • content_description: text string, up to 255 characters.

  • URL: text string of a valid URL, up to 255 characters.

Event

{
    "type": "content",
    "content": {
      "text": "",
    }
}
CODE
  • text: text string, up to 255 characters.

General

{
    "type": "general",
    "content": {
      {
        "title": "",
        "subtitle": "",
        "image": 'http://placehold.it/400x200',
        "image_description": "",
        "url": "",
        "responses": [
          {
            "type": "", 
            "label": "", 
            "action": ""
          }
        ]
      }
    }
}
CODE
  • title: text string, up to 255 characters.

  • subtitle: text string, up to 255 characters.

  • url: text string of a valid URL, up to 255 characters.

  • image: text string of a valid URL up to 255 characters.

  • image_description: text string, up to 255 characters.

  • responses: array, minimum 1, maximum 10.

  • responses (buttons): any button.

Image

{
    "type": "image",
    "content": {
      "url": "",
      "image_description": "",
      "text": ""
    }
}
NONE
  • url: text string of a valid URL, up to 255 characters.

  • text: text string, up to 255 characters.

  • image_description: text string, up to 255 characters.

  • full_size: true or false

Payment

{
    "type": "payment",
    "content": {
      "processor": "",
      "content_description": "",
    }
}
CODE
  • processor: global-pay

  • content_description: text string, up to 255 characters.

Progress

{
    "type": "progress",
    "content": {
      "text": ""
    }
}
CODE
  • text: text string, up to 255 characters.

Quick replies

{
    "type": "quick-reply",
    "content": {
      "text": "",
      "responses": [
        {
            "type": "", 
            "label": "", 
            "action": ""
        }
      ]
    }
}
CODE
  • text: text string, up to 255 characters.

  • responses: array, minimum 1, maximum 10.

  • label: text string, up to 255 characters.

  • postback: text string, up to 255 characters

Video

{
    "type": "video",
    "content": {
      "url": "",
      "text": "",
      "provider": "youtube",
      "content_description": ""
    }
}
CODE
  • text: text string, up to 255 characters.

  • content_description: text string, up to 255 characters.

  • provider: youtube or vimeo.

  • url: text string of a valid URL, up to 255 characters.