persistent_menu property of the Messenger Profile API. The menu automatically appears in a thread if the person has been away for a certain period of time and returns.pages_messaging permission.web_url — URL buttonpostback — Postback button| Property | Type | Description |
|---|---|---|
locale | String | The locale for this menu configuration. At least one object in the persistent_menu array must specify "locale": "default". This is the fallback menu if no object matches the user’s locale. See supported locales. |
composer_input_disabled | Boolean | Disables the Messenger composer field if set to true. The bot can only be interacted with via the persistent menu, postbacks, buttons, and webviews. Defaults to false. |
call_to_actions | Array | An array of top-level menu_item objects for the persistent menu. Maximum of 20 items. Required if composer_input_disabled is true. |
| Property | Type | Description |
|---|---|---|
type | String | The type of menu item: web_url or postback. |
title | String | Title to display on the menu item. 30 character limit. |
url | String | URL to open when the button is tapped. Required if type is web_url. |
payload | String | Data sent back to your webhook as a messaging_postbacks event. Required if type is postback. 1000 character limit. |
webview_height_ratio | String | Optional. Height of the webview. Valid values: compact, tall, full. |
messenger_extensions | Boolean | Optional. Must be true if the item type is web_url and the Messenger Extensions SDK will be used in the webview. |
fallback_url | String | Optional. URL to open in the webview for clients that do not support the Messenger Extensions SDK. If not defined, the url is used as the fallback. May only be specified if messenger_extensions is true. |
webview_share_button | String | Optional. Set to hide to disable sharing in the webview (for sensitive info). |
POST request to the Messenger Profile API to set the persistent_menu property. Up to 20 buttons are allowed in the call_to_actions array.{
"persistent_menu": [
{
"locale": "default",
"composer_input_disabled": false,
"call_to_actions": [
{
"type": "postback",
"title": "Talk to an agent",
"payload": "CARE_HELP"
},
{
"type": "postback",
"title": "Outfit suggestions",
"payload": "CURATION"
},
{
"type": "web_url",
"title": "Shop now",
"url": "https://www.originalcoastclothing.com/",
"webview_height_ratio": "full"
}
]
}
]
}
"composer_input_disabled": true when you create the persistent menu.persistent_menu array for each locale, setting the locale property to a supported locale:{ "locale": "default", "call_to_actions": [...] }, { "locale": "zh_CN", "call_to_actions": [...] }
custom_user_settings endpoint. This endpoint supports POST, GET, and DELETE calls. A psid parameter is needed to indicate the user that this override applies to.curl -X POST "https://graph.facebook.com/<LATEST_API_VERSION>/me/custom_user_settings" \
-H "Content-Type: application/json" \
-d '{
"psid": "<PSID>",
"persistent_menu": [
{
"locale": "default",
"composer_input_disabled": false,
"call_to_actions": [
{
"type": "postback",
"title": "Talk to an agent",
"payload": "CARE_HELP"
},
{
"type": "postback",
"title": "Outfit suggestions",
"payload": "CURATION"
},
{
"type": "web_url",
"title": "Shop now",
"url": "https://www.example.com/",
"webview_height_ratio": "full"
}
]
}
]
}' \
-F "access_token=<PAGE_ACCESS_TOKEN>"
curl -X GET "https://graph.facebook.com/<LATEST_API_VERSION>/me/custom_user_settings?psid=<PSID>&access_token=<PAGE_ACCESS_TOKEN>"
curl -X DELETE "https://graph.facebook.com/<LATEST_API_VERSION>/me/custom_user_settings?psid=<PSID>¶ms=[%22persistent_menu%22]&access_token=<PAGE_ACCESS_TOKEN>"