Buttons

Buttons can be used in Structure messages. They provide the user with ability to perform a predefined action, such as opening Messenger webview, send a postback message, share a content, and more.

Url Button

The Url Button opens an in-app Messenger webview (browser) with given address.

...
buttons: [
  {
    "type": "url",
    "title": "Freedom",
    "payload": "https://en.wikipedia.org/wiki/Liberty"
  }
]
...

Parameter

Type

Description

type*

string

Must be set to url.

title*

string

Title of the button. Max size is 20 characters.

payload*

string

Url to be opened.

🚧

Requires Domain Whitelisting

Url passed to the webview with url button must be whitelisted (including subdomains). See domain whitelisting.

Postback Button

When the user taps on the postback button, it sends developer-defined payload back on Postback Received webhook. You can perform an action or reply back when this happens.

...
buttons: [
  {
    "type": "postback",
    "title": "List Items",
    "payload": "{{PASS_THROUGH_PARAM}}"
  }
]
...

Parameter

Type

Description

type*

string

Must be set to postback.

title*

string

Title of the button. Max size is 20 characters.

payload*

string

Any arbitrary data you can send to Postback Received webhook. Max size is 1000 characters.

Call Button

Call Button initiates a phone call.

...
buttons: [
  {
    "type": "phone",
    "title": "Call Us",
    "payload": "+1 (555) 857-6309"
  }
]
...

Parameter

Type

Description

type*

string

Must be set to phone.

title*

string

Title of the button. Max size is 20 characters.

payload*

string

Phone number that will be dialed. Make sure the phone number is in international format.