从Facebook中的应用令牌获取页面令牌不工作



我试图使用Facebook应用令牌而不是用户令牌来获得页面令牌。但是我只能使用用户令牌获得页面令牌,而不能使用应用令牌。

这就是我在做的。首先,我以这种方式获得应用令牌:

https://graph.facebook.com/oauth/access_token?client_id=[app id omitted]&client_secret=[secret omitted]a&grant_type=client_credentials

然后我尝试使用应用令牌获取页面令牌:

https://graph.facebook.com/[page id omitted]?fields=access_token&access_token=[app token omitted]

但这是响应:

{
"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": "[trace id omitted]"
}
}

我的应用程序中的所有权限都有标准访问权限,我是页面的管理员。我还需要高级权限吗?

我尝试使用这里提供的工具检查我的应用令牌:

https://developers.facebook.com/tools/debug/accesstoken/

但是奇怪的是,我在输出中没有看到任何权限。这些是我检查令牌后得到的所有信息:

App ID  [id of the app omitted] : DemoApp
Type    App

我想知道从应用令牌获取页面令牌是否允许操作。我遗漏了什么?

不能使用应用令牌获取页面令牌

页面和你的应用程序之间没有连接-所以API如何确定,你是否应该有访问那个特定的页面开始?

用户可以是页面的管理员/版主-因此他们的令牌可以用来获得页面令牌,因为他们是页面的管理员这一事实证明了应该授予访问权限。

最新更新