【发布时间】:2021-11-15 03:45:26
【问题描述】:
我正在尝试使用 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
我想知道从应用令牌获取页面令牌是否是允许的操作。我在这里错过了什么?
【问题讨论】:
标签: facebook facebook-graph-api oauth access-token facebook-access-token