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
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?
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:
FB.api(
'/' + page_id + '/subscribed_apps',
'post',
{ access_token: page_access_token, subscribed_fields: 'leadgen' },
function (response) {
console.log('Successfully subscribed page', response);
});
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:
FB.login(function (response) {
...
}, {scope: ['manage_pages', 'leads_retrieval']});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With