seaders
seaders

Reputation: 4106

How do I get my own Facebook App-Scoped User Id with v2.0 of Graph?

On our game, a user is queryable in our database by a few fields, one being their fbid. In testing, we had a tool which queries Facebook via our usernames, along with the app access token, then queried our database with the Facebook id from that call.

Now, with Graph v2.0, our server is getting the app scoped id, 277..., but when we query Graph (v1.0, because querying by username isn't available in v2.0), we get their real Facebook id, which isn't what we set the user up with in the database.

Fair enough in v2.0, if we can't query by usernames, that's fine, we'll find another way, but how do I, as a developer of an app, find the app-scoped id Facebook has given me, for my own app?

Upvotes: 1

Views: 2778

Answers (1)

Andy Borrell
Andy Borrell

Reputation: 166

You can use the graph explorer tool:

https://developers.facebook.com/tools/explorer/?method=GET&path=me

The tool has a dropdown list at the top of the page where you can select an app of which you are a developer. Choose your app in this list, then choose "Get Access Token", then press "Submit" to submit the default "/me" query.

The id field of the result will be your app-scoped user ID in this app.

Upvotes: 2

Related Questions