Reputation: 1
Making get request for creating page-access-token for facebook graph API returns blank data object.
The request is like below according to the official doc:https://developers.facebook.com/docs/facebook-login/guides/access-tokens/#pagetokens
curl -i -X GET "https://graph.facebook.com/{your-user-id}/accounts?access_token={user-access-token}"
This worked at least half years ago, now the request returns blank data[] object. I tried both curl command line and Graph API Explorer.
On Graph API Explorer, Submiting GET https://graph.facebook.com/{version}/{App-Scoped User ID}/permissions returns
{
"data": [
{
"permission": "pages_show_list",
"status": "granted"
},
{
"permission": "pages_read_engagement",
"status": "granted"
},
{
"permission": "pages_read_user_content",
"status": "granted"
},
{
"permission": "public_profile",
"status": "granted"
}
]
}
But submiting GET https://graph.facebook.com/{version}/{App-Scoped User ID}/accounts returns
{
"data": [
]
}
Any ideas to solve this issue?
[updated 1] I found the request works for another facebook account. I don't understand why for some accounts request returns blank data(i.e. blank page access token). The user account which fails to create page access token now is the one which could create access tokens last year.
[update 2-A] I checked differences between working example and failed one, and found that requested pages_read_user_content looks like canceled or ignored for the failed one. On graph explorer, after doing "get page access token", pages_show_list and pages_read_engagement are successfully added, but pages_read_user_content is pending with green-colored text. I think this is a hint of this issue, and this article may be related. [updated 2-B] I found another difference about them. After deactivating all permissions for the page on Business Integrations, the pending issue is solved, but the main issue is not solved, so pages_read_user_content seems to be not related to this issue.
[updated3 and solved] I found unofficial tips here. The solution process is a little bit tricky, first you have to run the Delete permission command like this:DELETE https://graph.facebook.com/{version}/{App-Scoped User ID}/permissions and deactivate the app for the facebook page on Business Integrations(after clicking View and edit button for the app, toggle and deactivate all of the WHAT BUSINESS FEATURES CAN BE MANAGED section). Once that's done, you create tokens again from scratch.
Upvotes: 0
Views: 119