skip to Main Content

I’m trying to subscribe a Facebook page to my facebook app. It’s a messenger app where I need to subscribe the page to my webhook added in the app.

Using the graph API, I have the page access token and page id, I have tried the subscribed_apps API but it didn’t work

 FB.api('/' + page.id+ '/subscribed_apps?access_token=' + 
         page.access_token,function (response) {
            console.log(response)
        });

Is there an API to make the page to subscribe to my webhook in the app.

2

Answers


  1. You can you the below API to subscribe the page to your webhook. Specify the fields you want to subscribe to using the subscribed_fields query parameter depends on your use case.

    `curl -i -X POST "https://graph.facebook.com/{page-id}/subscribed_apps
    ?subscribed_fields=feed
    &access_token={page-access-token}"`
    

    Example – If your use-case is related to page messaging use messages,message_echoes fields as subscribed_fields.

    Note – Your page access token should have pages_messaging permission.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search