Getting a page token from an app token in Facebook is not working

Viewed 192

I'm trying to use a Facebook app token instead of a user token to get a page token. But I can only get a page token with user token and not with app token.

Here's what I'm doing. First I get the app token in that way:

https://graph.facebook.com/oauth/access_token?client_id=[app id omitted]&client_secret=[secret omitted]a&grant_type=client_credentials

Then I try to get a page token with the app token:

https://graph.facebook.com/[page id omitted]?fields=access_token&access_token=[app token omitted]

But this is the response:

 {
    "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": "[trace id omitted]"
   }
}

All the permissions in my app have standard access and I'm the admin of the page. Do I also need advanced permissions?

I tried to inspect my app token with the tool provided here:

https://developers.facebook.com/tools/debug/accesstoken/

But strangely I don't see any permissions in the output. These are all the info I get after inspection of the token:

App ID  [id of the app omitted] : DemoApp
Type    App

I wonder if getting a page token from an app token is an allowed operation. What am I missing here?

1 Answers

You can not get a page token using an app token.

There is no connection between the page and your app - so how would the API determine, whether you are supposed to have access to that particular page to begin with?

Users can be admins/moderators on pages - and therefor their tokens can be used to get a page token, because the fact that they are an admin of the page, is what proves access should be granted.

Related