the bash command I used to connect the bot is: curl -ik -X POST 'https://graph.facebook.com/v2.6/me/messages?access_token=#AccessToken'
My error message is:
{"error":{"message":"(#100) The parameter recipient is required","type":"OAuthException","code":100,"fbtrace_id":"EFqWAGq2ABs"}}
Do anyone how to solve it ?
Just in case anyone missed this, I encountered this issue when I accidentally use the wrong content type - I was using application/x-www-form-urlencoded
instead of application/json
So my advise overall is,
You need to send the recipient id param. Try:
curl -X POST -H "Content-Type: application/json" -d '{ "recipient":{"id":"YOUR RECIPIENT ID" }, "message":{ "text":"hello from bot" }}' "https://graph.facebook.com/v2.6/me/messages?access_token=YOUR_ACCESSTOKEN"
Best regards.
There is another reason for this error message: when you send incorrect characters (like a -tab-) Facebook return this error as well so check your return text on special chars.
Please use the "thread_settings" endpoint "https://graph.facebook.com/v2.6/me/thread_settings" as your API endpoint.
You are using the messages endpoint.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With