My facebook Chatbot's persistent menu was working fine until a few days ago, once in every few tries when I click on a persistent menu item it would raise a popup error : Action Unsuccessful There was an error delivering your message to the bot. Please try again later.
This happens sporadically, and I checked that when this happens my PHP code's side didn't receive any postback from facebook. When there's no error the postback works fine. Is anyone else getting this error?
My Persistent menu is setup as such:
//-----------Persistent Menu
$url = 'https://graph.facebook.com/v2.6/me/messenger_profile?access_token='.$access_token;
$ch = curl_init($url);
$jsonData = '{
"persistent_menu":[
{
"locale":"default",
"composer_input_disabled": false,
"call_to_actions":[
{
"title":"View in Chinese",
"type":"postback",
"payload":"mainMenu"
},
{
"title":"View in English",
"type":"postback",
"payload":"mainMenuEN"
}
]
},
{
"locale":"zh_TW",
"composer_input_disabled": false,
"call_to_actions":[
{
"title":"View in Chinese",
"type":"postback",
"payload":"mainMenu"
},
{
"title":"View in English",
"type":"postback",
"payload":"mainMenuEN"
}
]
},
{
"locale":"en_US",
"composer_input_disabled": false,
"call_to_actions":[
{
"title":"View in Chinese",
"type":"postback",
"payload":"mainMenu"
},
{
"title":"View in English",
"type":"postback",
"payload":"mainMenuEN"
}
]
}
]
}';
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);