I have been building a Facebook Messenger bot and am having trouble receiving messages from Messenger at the webhook on my server. I've been working with the Send API & Webhooks for several weeks and have had no trouble sending messages back and forth to a user until today. I am able to validate the webhook from the Facebook Developer Console, and I can see the validation coming through on a GET call to my /webhook
route. However, when I message my bot (which should POST to /webhook
) from my personal account, I don't see any of the message data being forwarded to my server. The route never gets hit. The page I'm sending to is subscribed to the app in the Facebook Developer Console. What's strange is that I can manually hit /webhook
with a message using curl:
curl -i -X POST -H 'Content-Type: application/json' -d
'{"object":"page","entry":
[{"id":43674671559,"time":1460620433256,"messaging":[{"sender":
{"id":MY_ACTUAL_FACEBOOK_USER_ID},"recipient":
{"id":MY_PAGE_ID},"timestamp":1460620433123,"message":{"mid":"mid.1460620432888:f8e3412003d2d1cd93","seq":12604,"text":"Testing
Chat Bot .."}}]}]}' "https://XXXXX.ngrok.io/webhook"
I'm using ngrok to forward calls to my localhost. The above curl
command works fine, meaning I can see the message delivered on my server at /webhook
. To me this suggests the problem is coming from Facebook, which would mean it's out of my control. Is there anything I've missed? What else could I check, and why would this be failing silently?