33

Facebook has some great-looking examples of Open Graph requests here:

https://developers.facebook.com/docs/reference/api/examples/

The problem is that since I don't have an access token, most of the examples just return

{
   "error": {
      "message": "An active access token must be used to query information about the current user.",
      "type": "OAuthException",
      "code": 2500
   }
}

I understand access tokens, but how do I get the token so that I can experiment with these example requests?

Stéphane Bruckert
  • 21,706
  • 14
  • 92
  • 130
ohthepain
  • 2,004
  • 3
  • 19
  • 30
  • 1
    Access tokens are obtained when your app registers and a user logs in with the facebook api graph. If you're writing an app of some sort, you can get the access token from there and copy that over. I don't believe there's a way to get an access token another way. Here's the doc, you might find something in there https://developers.facebook.com/docs/facebook-login/access-tokens/ – dsrees Oct 24 '13 at 13:41

1 Answers1

48

As long as you only want to test...

Use the Graph API Explorer to generate a token with the permissions you want.

Selection Permissions pop-up

Don't hesitate to select all of them.

Then, just copy/paste the token at the end of each graph.facebook.com URL. For instance:

https://graph.facebook.com/v1.0/me/friends?access_token=<ACCESS_TOKEN>

The day you want to get the access taken for an app...

Start by reading this doc.

Community
  • 1
  • 1
Stéphane Bruckert
  • 21,706
  • 14
  • 92
  • 130