Vishwesh Shetty
Vishwesh Shetty

Reputation: 727

How to Unsubscribe an app for all Facebook pages Webhooks

I have a Facebook App which is subscribed to more than 20,000 pages. The server isn't able to process hooks from all these Facebook pages, I want to unsubscribe my app from all these Facebook pages. Is there a quicker way to do this. Most of the page access token I have is expired, so I can't loop through all the pages and unsubscribe my app from them.

Upvotes: 7

Views: 3462

Answers (1)

JMA
JMA

Reputation: 1825

To unsubscribe your app from a Facebook page, you do not need a token from the page. All you need is your App Access Token. To unsubscribe from the page just make a DELETE http request to:

https://graph.facebook.com/{page_id}/subscribed_apps?access_token={your_access_token}

You can get your App Access Token by sending a GET request to:

https://graph.facebook.com/oauth/access_token
    ?client_id={app-id}
    &client_secret={app-secret}
    &grant_type=client_credentials

So just make a DELETE request to each page you want to unsubscribe from.

Upvotes: 16

Related Questions