node.js - Facebook "active access token must be used"

标签 node.js facebook facebook-graph-api

我正在使用this对于我的 Node 应用程序。 我可以使用脚本获取 token ,并且让 /me 正常工作。但是当我尝试获取 me/accounts?fields=name,id&limit=1000 时,出现错误。

An active access token must be used to query information about the current user.

我测试我的 token here我得到了以下结果。

App ID  foo : bar
User ID 10153192307109460 : Krister Johansson
User last installed this app via API v2.x
Issued  1440597064 (about a minute ago)
Expires 1445781064 (in about 2 months)
Valid   True
Origin  Web
Scopes  manage_pages, publish_pages, publish_actions, public_profile

如果我在 Graph API Explorer 中测试我的 token ,我不会收到任何错误,并且它会列出我的帐户。

最佳答案

你有吗

FB.setAccessToken('YOUR_ACCESS_TOKEN');

在进行调用之前,其中 YOUR_ACCESS_TOKEN 是您代码中的实际访问 token ?

如果是这样,检查参数的传递是否像

FB.api('me/accounts', { fields: ['id', 'name'], limits: 1000 }, function (res) { ... });

请记住,该模块已有两年多的历史,很可能无法反射(reflect)最新的图形 API 更改。

关于node.js - Facebook "active access token must be used",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32228906/

相关文章:

node.js - 使用 Azure 存储/Blob 服务设置 Azure Node.js 应用服务的最佳方式是什么

php - 网站上的 FB 登录集成

node.js - 将 github 存储库设为私有(private)后 Circleci 安装失败

facebook - AWS 负载均衡器超时问题且 Node/Express 中没有错误

ios - FBSDKAppEvents.activateApp() 无法识别的选择器发送到实例

java - 如何动态处理facebook API版本升级异常

ios - 在 UIWebView 中访问公共(public) Facebook 个人资料(使用 access_token)

javascript - 使用 javascript API 执行 facebook 搜索

c - Node : Performance of Native Addon vs External Binary

node.js - 如何使用嵌套数组文档进行 Mongoose 聚合