Skip to main content
Skip table of contents

Discover each dynamic message template

Last updated: 03 April 2024

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

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

Action

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

  • responses: array, minimum 1, maximum 10.

  • responses (buttons): any button (see below).

Carousel

CODE
{
    "type": "carousel",
    "content": {
      "items": [
        {
          "title": "",
          "subtitle": "",
          "image": 'http://placehold.it/400x200',
          "image_description": "",
          "url": "",
          "responses": [
            {
            "type": "", 
            "label": "", 
            "action": "",
            "expires": true
            }
          ]
        }
      ],
    }
}
  • 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 (see below).

Content

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

  • title: text string, up to 255 characters.

  • markdown: text string, up to 255 characters.

Embed

CODE
{
    "type": "content",
    "content": {
      "text": "",
      "title": "",
      "url": ""
    }
}
  • 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

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

General

CODE
{
    "type": "general",
    "content": {
        "title": "",
        "subtitle": "",
        "full_size": false,
        "image": "http://placehold.it/400x200",
        "image_description": "",
        "url": "",
        "responses": [
          {"type": "postback", "label": "", "action": "","expires": true}
        ]
    }
}
  • 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 (see below).

Image

NONE
{
    "type": "image",
    "content": {
      "url": "",
      "image_description": "",
      "text": ""
    }
}
  • 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

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

  • content_description: text string, up to 255 characters.

Progress

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

Quick replies

CODE
{
    "type": "quick-reply",
    "content": {
      "text": "",
      "responses": [
        {
            "type": "", 
            "label": "", 
            "action": ""
        }
      ]
    }
}
  • 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

CODE
{
    "type": "video",
    "content": {
      "url": "",
      "text": "",
      "provider": "youtube",
      "content_description": ""
    }
}
  • 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:

CODE
[
{
    "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"}
      ]
    }
}
]

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

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

  • type: has to equal postback.

  • label: text string, up to 255 characters.

  • action: text string, up to 255 characters.

  • expires: boolean.

Mailto

CODE
"responses": [
        {"type": "mailto", 
          "label": "", 
          "action": "",
          "linkback": "",
          "expires": true}
      ]
  • 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.

  • expires: boolean.

Callto

CODE
"responses": [
        {"type": "callto", 
          "label": "", 
          "action": "",
          "linkback": "",
          "expires": true}
      ]
  • 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.

  • expires: boolean.

URL

CODE
"responses": [
        {"type": "url", 
          "label": "", 
          "action": "",
          "linkback": "",
          "expires": true}
      ]
  • 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.

  • expires: boolean.

File

CODE
"responses": [
        {"type": "file", 
          "label": "", 
          "action": "",
          "linkback": ""}
      ]
  • 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.

  • expires: boolean.

Content

CODE
"responses": [
        {"type": "contentButton", 
          "label": "", 
          "action": "",
          "linkback":"",
          "expires": true}
      ]
  • 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.

  • expires: boolean.

      

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.