How to get the access token?

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?


As long as you only want to test...

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

选择权限弹出

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.

链接地址: http://www.djcxy.com/p/32592.html

上一篇: Facebook Graph API访问客户端令牌/匿名?

下一篇: 如何获取访问令牌?