给出一个Facebook页面ID并使用页面访问令牌,有没有办法找到页面管理员的ID?
我一直在寻找页面(https://developers.facebook.com/docs/graph-api/reference/page/)的API文档,但没有发现任何东西。是否有授予此权限的特定权限?如果是这样,我该如何检索信息?
答案 0 :(得分:0)
经过大量研究,我发现有可能页面访问令牌具有 manage_pages 权限。
这将通过以下方式起作用:
graph.facebook.com/{page-id}?fields=roles&access_token={your-access-token-goes-here}
响应看起来像这样:
{
"roles": {
"data": [
{
"name": "Robert M. Vunabandi",
"id": "{some-id}",
"tasks": [
"ANALYZE",
"ADVERTISE",
"MODERATE",
"CREATE_CONTENT",
"MANAGE"
],
"is_active": true
}
],
"paging": {
"cursors": {
"before": "{some-hash-strings}",
"after": "{some-hash-strings}"
}
}
},
"id": "{page-id-same-as-in-api-call}"
}
如果未在访问令牌中授予 manage_pages 权限,则会看到:
{
"error": {
"message": "(#283) Requires manage_pages permission to manage the object",
"type": "OAuthException",
"code": 283,
"fbtrace_id": "{some-facebook-trace-string}"
}
}