How To Get Your Facebook Id

🦖 This post was published in 2011 and is most likely outdated.

You may need to get your Facebook token if you install a Facebook plugin on your website or if you develop a Facebook application. To get your Facebook ID, go to the Facebook API reference page, look for the link graph.facebook.com/me (right above the Pictures title) and click it. You can then see your Facebook ID:

"id": "1536397056"

Why do I get an error if I go directly to graph.facebook.com/me?

It is because that URL is part of the Facebook API which is not made to be used directly but by third-party applications (applications which are not Facebook but that can access your Facebook data).

To be sure that one application is allowed to ask for your private data, Facebook gives it a kind of password (an access token) if you have allowed this application. Your data is given only if the token is valid, otherwise it returns the error message you may have seen.

Now, when Facebook generate the Facebook API reference page, it provides to each URL (that are API requests), a temporary access token in order to make you able to see examples of real responses:

https://graph.facebook.com/me?access_token=983798430|dslfuqsf...

This access token (which is in fact a lot more longer than that) becomes invalid as soon as you log out from Facebook.

Comments