我正在尝试使用 test console 中的 getCount
.
当我输入已安装我的应用程序的用户的uid
(使用基本和publish_stream
权限)时,我收到以下错误:
{
"error_code": 240,
"error_msg": "Requires a valid user is specified (either via the session or via the API parameter for specifying the user.",
"request_args": [
{
"key": "uid",
"value": "REMOVED_USER_ID"
},
{
"key": "method",
"value": "dashboard.getCount"
},
{
"key": "access_token",
"value": "REMOVED_ACCESS_TOKEN"
},
{
"key": "format",
"value": "json"
}
]
}
有什么想法为什么会发生这种情况吗?我该如何修复它?我需要一些额外的权限吗?
最佳答案
约翰,您不需要额外的权限。问题出在您的访问 token 上。该工具使用的访问 token 是您的个人用户访问 token ,并且仅适用于您的 uid。如果您使用应用程序访问 token (即 APP_ID|APP_SECRET),那么您将能够为应用程序的所有用户看到此方法的结果。
api.facebook.com/method/dashboard.getCount?uid=[UID]&access_token=[appid|appsecret]&format=json
关于facebook - 使用getCount时出现"Requires a valid user is specified ..."错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6859237/