I want to use nested menus for a Facebook bot, but the new API to set the persistent menu does not work.
Even if I remove the nested menu, Facebook returns “success” but the Facebook page does not show the menu.
If I use the old API on thread_settings, then it works. But using the new API I get no menu at all. The new API works for the getting started button, but not the menu.
I have tried everything, and have no idea why it is not working. It returns success but no menu. I am setting the getting started button too.
curl -X POST -H "Content-Type: application/json" -d '{
"persistent_menu":[
{
"locale":"default",
"composer_input_disabled":false,
"call_to_actions":[
{
"type":"web_url",
"title":"Test",
"url":"https://facebook.com"
}
]
}
]
}' "https://graph.facebook.com/v2.6/me/messenger_profile?access_token={{token}}"
4
Answers
I have tried it and it works.
checkout the code here
You can try the bot here: https://www.facebook.com/nautankibot/
I will have to add you as tester if you want to use this bot as its not public.
Screenshot of nested menu in the bot:
It works on fb messenger app as well.
In the above curl call you have not set the type as “nested” in
call_to_actions
The above example is taken from fb documentation for menus
I found that the Graph API Explorer gave me alot more success than the curl commands.
Just select the page you are posting to in the “Get Token” menu.
Set to Post to me/messenger_profile,
add field name as “persistent_menu”,
and the value as your json array.
It will tell you if anything is wrong with your post.
your json should look something like this for nested.
Graph API Explorer also worked for me.
I made a mess trying to delete the persistent menu via CURL. (I love terminal). It was easy to resolve using the Explorer.
Just remembering:
screenshot using Graph API Explorer
you can use this format fb v8
{
"locale": "default",
"composer_input_disabled": false,
"call_to_actions": [
{
"type": "postback",
"title": "🔰 عرض بالتصنيفات ",
"payload": "Category"
},