facebookfacebook-graph-apiwebhooksfacebook-messenger

Facebook Messenger webhook setup, but not triggered


So I'm trying to setup a bot for the new Facebook Messenger API.

I'm following the quickstart.

I setup the webhook ok, and see it in my webhooks,

I called this:

https://graph.facebook.com/v2.6/me/subscribed_apps?access_token=%3Ctoken%3E

and it did not throw any errors,

But when I go to the Page that I generated the access token on, and send a message, it does not call my webhook. I check the httpaccess, and it does not call it.

Any way to debug this or any ideas?

Also, one thing I'm still puzzled over is how to support managing multiple pages from one Facebook app? Anyone know the answer to this, or do you need to create anew app and get permission for every page?


Solution

  • So my issue was I was calling GET when trying to subscribe instead of POST

    https://graph.facebook.com/v2.6/:pageid/subscribed_apps?access_token=:token
    

    GET will return the current subscriptions (empty {[]}), POST returns {"success" : "true"}

    Some other gotchas I hit were,

    One thing I'm still puzzled over is how to support managing multiple pages from one Facebook app? Anyone know the answer to this, or do you need to create anew app and get permission for every page?