“需要指定有效用户..."使用 getCount 时出错 [英] "Requires a valid user is specified ..." error when using getCount

查看:23
本文介绍了“需要指定有效用户..."使用 getCount 时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 test 中的 getCount控制台.

I'm trying to use getCount from test console.

当我输入安装了我的应用程序的用户的 uid(使用基本和 publish_stream 权限)时,我收到以下错误:

When I enter a uid of a user that has installed my application (using basic and publish_stream permissions) I get the following error:

{
  "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"
    }
  ]
}

任何想法为什么会发生这种情况?我该如何解决?我需要一些额外的权限吗?

Any ideas why is this happenning? How can I fix it? Do I need some extra permissions?

推荐答案

John,您不需要额外的权限.问题在于您的访问令牌.该工具使用的访问令牌是您的个人用户 访问令牌,并且仅适用于您的 uid.如果您使用应用程序 访问令牌(即 APP_ID|APP_SECRET),那么您将能够为应用程序的所有用户看到此方法的结果.

John, you don't need extra permissions. The problem is with your access token. The access token that the tool uses it your personal user access token and will only work for your uid. If you use the application access token (meaning APP_ID|APP_SECRET) then you will be able to see the result of this method for all users of your application.

api.facebook.com/method/dashboard.getCount?uid=[UID]&access_token=[appid|appsecret]&format=json>

api.facebook.com/method/dashboard.getCount?uid=[UID]&access_token=[appid|appsecret]&format=json

这篇关于“需要指定有效用户..."使用 getCount 时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆