Last updated: 02 March 2023

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.

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": "",
        "full_size": false,
        "image": "http://placehold.it/400x200",
        "image_description": "",
        "url": "",
        "responses": [
          {"type": "postback", "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.

Send multiple dynamic messages in one step

To send multiple dynamic messages in one step, separate the templates with a simple comma like so:

[
{
    "type": "action",
    "content": {
      "text": "How are you doing?",
      "responses": [
        {"type": "postback", "label": "BBBBBB", "action": "BBBBBB"}
      ]
    }
},
{
    "type": "quick-reply",
    "content": {
      "text": "Something else?",
      "responses": [
        {"label": "AAAAAA", "postback": "AAAAAA"}
      ]
    }
}
]
CODE

Notice you can send multiple message types in one template using this approach!

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.

Content

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

  • label: text string, up to 255 characters.

  • action: knowledge base article ID.

  • linkback: optional text string, up to 255 characters.