


commands Format"commands": [ { "locale": "default", "commands": [ { "name": "flights", "description": "Find real-time flights and fares" }, { "name": "hotels", "description": "Find real-time hotel rooms and rates" }, { "name": "currency", "description": "Find real-time currency exchange rates" }, { "name": "weather", "description": "Find real-time weather reports and forecasts" } ] } ]
commands array for each locale. To specify the locale for each object, set the locale property to a supported locale:"commands": [ { "locale": "default", "commands": [...] }, { "locale": "zh_CN", "commands": [...] } ]
| Property | Type | Description |
|---|---|---|
locale | String | Locale of the commands array. The corresponding array of commands will be displayed when the user’s locale matches the provided locale.
You must at least specify commands for the default locale, which will be displayed if no provided locale matches the user’s locale. See the list of supported locales |
commands | Array< command> | An array of commands to display to users in the provided locale.
The array should contain a minimum of 1 and a maximum of 100 commands. |
command object| Property | Type | Description |
|---|---|---|
name | String | The name of the command. Keep it short and easy for users to remember. The command should not begin with a / (slash character).
Minimum of 1 and maximum of 32 characters. |
description | String | Description of the command. Use the description to educate users about what the command does and how to use it.
Minimum of 1 and maximum of 64 characters. |
curl -X GET "https://graph.facebook.com/v25.0/me/messenger_profile?fields=commands&access_token=<PAGE_ACCESS_TOKEN>"
{ "data": [ { "commands": [ { "locale": "default", "commands": [ { "name": "flights", "description": "Find real-time flights and fares" }, { "name": "hotels", "description": "Find real-time hotel rooms and rates" }, { "name": "currency", "description": "Find real-time currency exchange rates" }, { "name": "weather", "description": "Find real-time weather reports and forecasts" } ] } ] } ] }
curl -X POST -H "Content-Type: application/json" -d '{
"commands": [
{
"locale": "default",
"commands": [
{
"name": "flights",
"description": "Find real-time flights and fares"
},
{
"name": "hotels",
"description": "Find real-time hotel rooms and rates"
},
{
"name": "currency",
"description": "Find real-time currency exchange rates"
},
{
"name": "weather",
"description": "Find real-time weather reports and forecasts"
}
]
}
]
}' "https://graph.facebook.com/v25.0/me/messenger_profile?access_token=<PAGE_ACCESS_TOKEN>"
{ "result": "success" }