URL Button Reference

The URL Button opens a webpage in the Messenger webview. This button can be used with the Button and Generic Templates.

For more information on using the URL button, see URL Button.

Contents

Example

Required Domain Whitelisting

To display a webpage in the Messenger webview you must whitelist the domain, including sub-domain, in the whitelisted_domains property of your bot's Messenger Profile. This ensures that only trusted domains are opened by your Messenger bot.

For more information on whitelisting domains, see the whitelisted_domains reference.

...

"buttons":[
  {
    "type":"web_url",
    "url":"https://petersfancyapparel.com/criteria_selector",
    "title":"Select Criteria",
    "webview_height_ratio": "full",
    "messenger_extensions": true,  
    "fallback_url": "https://petersfancyapparel.com/fallback"
  }
]
    
...

Example Response

{
  "recipient_id": "1254477777772919",
  "message_id": "mid.$cAAJsujCd2ORj_1qmrFdzhVa-4cvO"
}  

Properties

Property Type Description

type

String

Type of button. Must be web_url.

title

String

Button title. 20 character limit.

url

String

This URL is opened in a mobile browser when the button is tapped. Must use HTTPS protocol if messenger_extensions is true.

webview_height_ratio

String

Optional. Height of the Webview. Valid values: compact, tall, full. Defaults to full.

messenger_extensions

Boolean

Optional. Must be true if using Messenger Extensions.

fallback_url

String

The URL to use on clients that don't support Messenger Extensions. If this is not defined, the url will be used as the fallback. It may only be specified if messenger_extensions is true.

webview_share_button

String

Optional. Set to hide to disable the share button in the Webview (for sensitive info). This does not affect any shares initiated by the developer using Extensions.