简体   繁体   English

Facebook-当前的访问令牌是什么?

[英]Facebook - what is the current access token?

After logging in with {scope:'publish_actions,manage_pages'} , I request the list of pages using the graph API as 使用{scope:'publish_actions,manage_pages'}登录后,我使用图形API请求页面列表为

FB.api('/me/accounts', function(response)  {

  .....
  ..... this gives me the list of pages and their page tokens

 }

Now my Question is which access token or page token would future "/me" be translated to? 现在,我的问题是将来的“ / me”将转换为哪个访问令牌或页面令牌?

For example, I now refer to 例如,我现在指的是

1) FB.api("/me",............) Does this me refer to the user id or any of the page id's retrieved above? 1) FB.api("/me",............)我是指用户ID还是上面检索到的任何页面ID?

2) FB.api("/platform",........) Again which page will the api read here? 2) FB.api("/platform",........) api将在此处再次读取哪一页? (I am confused because I don't see the page-id being passed explicitly to the api function. (我很困惑,因为我没有看到将页面ID显式传递给api函数。

FB.api( "/me",... .........) Does this me refer to the user id or any of the page id's retrieved above? FB.api(“ / me”,... .........)我是指用户ID还是上面检索到的任何页面ID?

That depends of course on the access token used to make the request – if it's a user access token, it will refer to the user, and if it's a page access token, it will refer to the page. 当然,这取决于用于发出请求的访问令牌–如果它是用户访问令牌,它将引用用户,如果是页面访问令牌,它将引用页面。 (And if it's just the app access token, then it will result in an error.) (而且,如果这只是应用程序访问令牌,那么将导致错误。)

FB.api( "/platform", ........) Again which page will the api read here ? FB.api(“ / platform”,........)api将再次在哪一页读取?

The one that has the username platform set of course. 当然有用户名platform集的人。

( I am confused because I don't see the page-id being passed explicitly to the api function. (我很困惑,因为我没有看到页面ID明确传递给api函数。

It does not have to be an id, usernames of users or pages work as well. 没有成为一个ID,用户或页面的用户名以及工作。 (Well, expect for the fact that the field username has been removed in API v2.0.) (好吧,期待API v2.0中已删除字段username的事实。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM