Buttons

Buttons

You can use buttons with each types: call, url, node.

{
  "version": "v1",
  "content": {
    "messages": [
      {
        "type": "text",
        "text": "simple text",
        "buttons": [
          {
            "type": "url",
            "caption": "External link",
            "url": "https://alendei.com",
          },
          {
            ...Another buttons
          }
        ]
      },
      {
        ...Another messages
      }
    ],
    "actions": [  //optional
      {
        "action": "add_tag",
        "tag_name": "example tag"
      },
      {
        ...Another actions
      }
    ],
    "quick_replies": [ //optional
      {
        "type": "node",
        "caption": "Quick reply text",
        "target": "My Content"
      },
      {
        ...Another quick replies
      }
    ]
  }
}

Call button


{ "version": "v1", "content": { "messages": [ { "type": "text", "text": "simple text with button", "buttons": [ { "type": "call", "caption": "Call me", "phone": "+1 (555) 555-55-55" } ] } ], "actions": [], "quick_replies": [] } }

Url button


There are 3 options of webview_size:

full - (100%),

medium - (75%),

compact - (50%)

The "webview_size" property is optional.

{
  "version": "v1",
  "content": {
    "messages": [
      {
        "type": "text",
        "text": "simple text with button",
        "buttons": [
          {
            "type": "url",
            "caption": "External link",
            "url": "https://alendei.com",
            "webview_size": "full"
          }
        ]
      }
    ],
    "actions": [],
    "quick_replies": []
  }
}

Go to node button


{
  "version": "v1",
  "content": {
    "messages": [
      {
        "type": "text",
        "text": "simple text with button",
        "buttons": [
          {
            "type": "node",
            "caption": "Show",
            "target": "My Content"
          }
        ]
      }
    ],
    "actions": [],
    "quick_replies": []
  }
}

target key should be linked to a node existing within executed flow. Node name can be found in its header, you need to use unique name for node connected with link. If there are multiple nodes with similar names inside of the same flow, transition behavior would not meet expectations. Go to node buttons are not supported in Public API.

Dynamic block callback button

The "headers", "payload" properties are optional.

{
  "version": "v1",
  "content": {
    "messages": [
      {
        "type": "text",
        "text": "simple text with button",
        "buttons": [
          {
            "type": "dynamic_block_callback",
            "caption": "Dynamic content",
            "url": "https://your-service.com/dynamic",
            "method": "post",
            "headers": {
              "x-header": "value"
            },
            "payload": {
              "key": "value"
            }
          }
        ]
      }
    ],
    "actions": [],
    "quick_replies": []
  }
}

dynamic_block_callback works the same way as dynamic block in a content node, it will send a request to the server upon click, server reply will be sent to user. External server URL must be mentioned with HTTPS protocol.


    • Related Articles

    • Messages format

      Sending text Use this response for sending text messages. url, node and call buttons can be used with text message. The "buttons", "actions", "quick_replies" properties are optional. { "version": "v1", "content": { "messages": [ { "type": "text", ...
    • Quick replies

      quick_replies property of server response is optional. Quick replies cannot be used in dynamic block of a content node if there are other blocks exist afterwards. Quick reply description format is the same for buttons, it supports content, node, ...
    • STOP-LIGHT DOCUMENTATION for Template API

      STOP-LIGHT DOCUMENTATION The released documentation covers how to use APIs to send templates directly from the Marketing panel. POST https://connect.api-wa.co/project-apis/v1/project/{project_id}/messages PARAMETER Project_id : XXX AUTH ...
    • Actions format

      Action add tag Use this response to add a tag to a subscriber. Tag with the same name must exist in your bot: { "version": "v1", "content": { "messages": [ { "type": "text", "text": "simple text with button", "buttons": [ { "type": "url", "caption": ...
    • Keywords

      With "Keyword", your users can easily jump to sub flows by typing in keywords rather than being lost in menus or buttons. go "Automation" from the sidebar click "Keywords" for "default reply", see explaination below click "+ New Keyword" choose a ...