Reputation: 11
I'm trying to get public profile using user_token. I registered FB app and get user_token from page: https://developers.facebook.com/tools/access_token/ but when I try to get public profile https://graph.facebook.com/100000378611443?limit=1000&access_token={user_token} I see an error:
{
"error": {
"message": "The global ID 100000378611443 is not allowed. Please use the application specific ID instead.",
"type": "OAuthException",
"code": 2500
}
}
But if I use user_token in above URL from another my app I can successfully get public user profile. What am I doing wrong? Thanks.
Upvotes: 1
Views: 4211
Reputation: 21520
Happens to me too, trying to using "Graph Api Explorer" with an user id obtained debugging my application.
User id that obtain from a call as:
../<event_id>/likes
isn't REAL user id, but a kind of id "encrypted" (let me use the word) with access_token.
So if you wanna test that user id on GAE, you need to specify also access token:
https://graph.facebook.com/<user_id>?access_token=<application_access_token>
Upvotes: 0
Reputation: 702
You must use access token, not user token! You can obtain one from Graph API Explorer here https://developers.facebook.com/tools/explorer Then you must have at least user_about_me permission to get profile data. As many user data permissions you have, as many endpoints and data you obtain. Keep in mind, access token you get from Graph API Explorer is short living - expires in an hour or so. More about tokens and their terms here: https://developers.facebook.com/docs/facebook-login/access-tokens
Upvotes: 0
Reputation: 16
You can still use the older version of Facebook Graph API V1.0 which will continue to exist until April 30th, 2015.
https://graph.facebook.com/v1.0/100000378611443
Upvotes: 0
Reputation: 336
Since v2.0 of Facebook API apps are no longer allowed to use global IDs, just app-scoped ID. These ID are generated when a user logs in onto your application.
If you are attempting to retrieve current logged in user's information, you should use /me
endpoint along with the user's access token: https://graph.facebook.com/me?access_token={user_token}
Note that with these new scoped IDs, apps are not allowed to retrieve any data from users who haven't gave permissions to the app.
Cheers
Upvotes: 2