Facebook Messenger bot error: The parameter recipient is required

Stefano Franzoni picture Stefano Franzoni · Jun 5, 2016 · Viewed 16.9k times · Source

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 ?

Answer

Alvin Reyes picture Alvin Reyes · Mar 30, 2017

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,

  • Check if you are indeed passing the parameter
  • Double check the characters and encoding
  • Make sure to use the correct endpoint
  • and Make sure to use the correct content type when posting the JSON Request.