Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The global ID is not allowed. Please use the application specific ID instead

In Graph API 2.0

When I using new graph api to access my friends information, I got the message below.

Here, xxx is an user id.

{
  "error": {
    "message": "The global ID xxx is not allowed. Please use the application specific ID instead.", 
    "type": "OAuthException", 
    "code": 2500
  }
}

What's application specific ID? At least, there's nothing in the docs about that. (If I use Graph API 1.0, everything will be fine.)

like image 474
Shih-En Chou Avatar asked May 03 '14 03:05

Shih-En Chou


1 Answers

Here's an excerpt from a blog post I wrote on this topic that answers your question:

In the simpler days of v1.0, when the Graph API reported on a user, the id value it provided was a global id number for that Facebook user. These values were “global” in the sense that they could be shared between client applications. In v2.0, all user data provided by the /user endpoint and its children use application-specific ids. These ids are a unique identifier not just of the Facebook user, but of the client-user pair. This mean that you can’t share user ids between applications. (Though Facebook does provide an API for mapping between applications that are part of single organization.)

An important consequence of this fact is that the user ids recognized by the Facebook applications you use for development will not match the ones your production app recognizes. So, if you store your users’ Facebook ids in your database in production, you won’t be able to match up users in that database with data returned from the API in development. That’s annoying!

And there’s no way around it. You’ll just have to query for a few of your friends from the development app and manually overwrite their stored Facebook ids in your development database. This will give you a few exemplars to develop against.

like image 187
hoffm Avatar answered Oct 15 '22 06:10

hoffm