I cannot seem to generate a page access token. I’ve tried using the Graph API Explorer by selecting "Get Page Access Token" from the User or Page dropdown, but it opens a window with the following error:
I’ve also tried sending the following API request but even though it returns a 200 OK
status code, the content is an empty array!
curl -i -X GET "https://graph.facebook.com/{your-user-id}/accounts?access_token={user-access-token}
Result:
{"data":[]}
I’ve also tried to get the page access token with the following command:
curl -i -X GET "https://graph.facebook.com/v14.0/<page_id>?access_token=<user_access_token>&fields=access_token"
Result:
{"error":{"message":"(#100) Object does not exist, cannot be loaded due to missing permission or reviewable feature, or does not support this operation. This endpoint requires the 'pages_read_engagement' permission or the 'Page Public Content Access' feature or the 'Page Public Metadata Access' feature. Refer to https://developers.facebook.com/docs/apps/review/login-permissions#manage-pages, https://developers.facebook.com/docs/apps/review/feature#reference-PAGES_ACCESS and https://developers.facebook.com/docs/apps/review/feature#page-public-metadata-access for details.","type":"OAuthException","code":100,"fbtrace_id":"AIx208__9nozhxypMyxZYpy"}}
My user is listed as the admin for this page and I previously was able to create page access tokens simply by using the Graph API Explorer above.
In the Graph API Explorer, I don’t seem to have any such option for ‘pages_read_engagement.’
How can I generate a page access token?
Note: I’ve also asked this question on the Facebook Developer Community Forum but no one has answered yet. This seems like a simple question so I’m surprised I’ve not gotten any responses thus far. https://developers.facebook.com/community/threads/911494286473743/
Ref. https://developers.facebook.com/docs/facebook-login/guides/access-tokens#pagetokens
2
Answers
If you’re admin and you’ve Facebook Page ID of the page you need access token then you can use following API to fetch page access token –
You can also use Graph API Explorer to fetch the same using user token.
Ask for the permission
business_management
access permission. There is not a word about this in the docs, but it fixed it for me.My problem started occurring after I became a full admin in meta business manager.