facebook - Facebook Graph API,无法使用应用令牌获取页面令牌
问题描述
使用图形 api,我正在尝试使用应用令牌(而不是使用用户令牌)获取页面令牌。
根据此处的文档,应该可以使用应用令牌:
https://developers.facebook.com/docs/facebook-login/access-tokens/
首先,我调用上面文档中提到的如下api来获取app token
如上述文档所述:“此调用将返回一个应用访问令牌,该令牌可用于代替用户访问令牌来进行 API 调用”
我成功获取了应用令牌,然后我用它来获取页面令牌:
https://graph.facebook.com/[page-id]?fields=access_token&access_token=[token]
但在这里我得到以下错误:
{
"error": {
"message": "(#100) Object does not exist, cannot be loaded due to missing permission or reviewable feature, or does not support this operation. This endpoint requires the 'pages_read_engagement' permission or the 'Page Public Content Access' feature or the 'Page Public Metadata Access' feature. Refer to https://developers.facebook.com/docs/apps/review/login-permissions#manage-pages, https://developers.facebook.com/docs/apps/review/feature#reference-PAGES_ACCESS and https://developers.facebook.com/docs/apps/review/feature#page-public-metadata-access for details.",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "[omitted]"
}
}
如果我改用用户令牌,则可以轻松获取页面令牌,但在使用应用令牌时则不行。我可以看到我在我的应用程序中拥有 pages_read_engagement 权限和“标准访问权限”。有什么问题?
解决方案
推荐阅读
- r - 计算R中的频率或百分比矩阵
- linux - 是否可以从 Cygwin 运行带有参数的命令到 Git Bash 终端?
- java - Java DriverManager.getConnection 在使用错误参数调用时挂起
- mysql - 在 HasOne 关系中出现关联错误
- python - 计算两个相同长度列表中的索引组合
- javascript - 速度阅读器 javascript 使合并的单词
- c++ - 如何避免在基于范围的 for 循环中使用 auto 说明符?
- r - 在R中结合堆栈和组条形图
- python - 在创建运行我的服务器时生效的环境变量时遇到问题
- c# - 使用 dotnet 通用主机创建的控制台项目无法获取用于 ef 迁移的用户机密