I am creating an app that will pull leads from facebook pages that I manage and update them into Google Sheets subsequently.
I have setup the webhook, generated long lived page access token with following permissions
- manage_pages
- pages_show_list
- leads_retrieval
- ads_management
- ads_read
When I try to subscribe the page to my app using POST request {page_id}/subscribed_apps
I get the below error
{
"error": {
"message": "(#100) The parameter subscribed_fields is required.",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "Fv7RbO8tYqo"
}
}
Researching revealed that facebook has added a new parameter called subscribed_fields in v3.2 api, but I am not sure how values must be passed to that parameter or is there something I am missing?
6
Answers
Im havint the same problem when i try to add a webhook for a facebook_lead ads campaign… it used to work perfectly on previous versions, im passing the scope:
“manage_pages”
}
Maybe, this can help for you guys:
https://developers.facebook.com/docs/graph-api/reference/page/subscribed_apps/#Creating
like this in form of POST request:
https://graph.facebook.com/v3.2/me/subscribed_apps?subscribed_fields=
So you need create this. 🙂
I have some issue with permissions, what is weird because I double checked my page permissions here:
https://developers.facebook.com/tools/debug/accesstoken
and seemingly I have the permissons that is missed in the message of the fb error response.
I got this response:
}
But I hope you can avoid this error. 🙂
As of facebook api v3.2, I also ran into problems.
Here’s what fixed @AdityaChowdhary’s original issue: -add “subscribed_fields: ‘leadgen'” as a post parameter, like this:
Then, you may run into another error: “To subscribe to the leadgen field, one of these permissions is needed: leads_retrieval”.
To prevent the permissions error: add the “leads_retrieval” permission to the fb.login scope, like this:
In the new Graph API v3.2, you must pass a parameter
subscribed_fields
, along with thepost
requestme/subscribed_apps
(with the page access token as the access token). You need to pass an array of available subscribable fields that are:Like e.g.:
subscribed_fields: ['messages', 'message_deliveries']
Adding subscribed_fields=publisher_subscriptions in request worked for me.
Here is the code:
For the fb.login you cant use ‘manage_pages’ as scope please try to use following: