0
votes

My applicaton uses this endpoint to retrieve a list of pages to which a user has access.

For my personal account, which is the admin of a page, it works fine:

https://graph.facebook.com/me/accounts?access_token=[accesstoken_for_my_personal_profile]

Results:
{
   "data": [
      {
         "access_token": "<the access token>",
         "category": "Record Label",
         "name": "Page Name",
         "id": "Page ID",
         "perms": [
            "ADMINISTER",
            "EDIT_PROFILE",
            "CREATE_CONTENT",
            "MODERATE_CONTENT",
            "CREATE_ADS",
            "BASIC_ADMIN"
         ]
      }
    ]
}

But when we create a totally new facebook profile (regular user, as per my personal one) - and get it verified using mobile phone / SMS based verification, it only ever returns blank here, despite being given page admin access to the same page and having requested an access token exactly the same way:

https://graph.facebook.com/me/accounts?access_token=[accesstoken_for_newly_created_profile]

{
   "data": [

   ]
}

UPDATE The access token permissions are also different.

So when calling https://graph.facebook.com/me/permissions?access_token=xxx, the bad user only has public_profile and installed as 'granted' - but the good user has all the requested permissions including 'manage_pages'.

The URL used to request the tokens in the first place is here: https://www.facebook.com/dialog/oauth?client_id=[my_app_id]&redirect_uri=https://www.facebook.com/connect/login_success.html&scope=manage_pages,read_mailbox,read_stream,publish_actions,user_likes&response_type=token

This directs to a login page which logs in as the user for which we want a token.

1
Debug the access token for the “new” user, and see if it actually contains the permissions you think it does. developers.facebook.com/tools/debugCBroe
No it doesn't - I'll update the question because the request for the access token was identical to the 'working' user. As if it wasn't able to issue a token with the requested permissions, watch out for the question update shortly.James Harcourt
Does the new user have a role in the app? Otherwise, you need to get your permissions reviewed by Facebook, before common users can be asked for them. developers.facebook.com/docs/facebook-login/permissions/…CBroe
Neither user have the app come up under 'apps' in their respective accounts, if that's what you mean. There are users that have worked in the past which haven't had roles in the app specifically assigned.James Harcourt
No, that’s not what I mean, I mean if this user is assigned an admin, developer or tester role in your app.CBroe

1 Answers

0
votes

Courtesy of @CBroe above:

The issue here was that since API v2.0 came in, requesting access tokens for users who do not have a role in the requesting app will not assign certain permissions (in our case 'manage_pages') unless the app has been reviewed.