【问题标题】:VK API java sdk account.getProfiles access denied?VK API java sdk account.getProfiles 访问被拒绝?
【发布时间】:2017-10-28 08:13:16
【问题描述】:

我正在使用 VK API,并设置了一个应用程序并设置了到目前为止我需要的一切。 但是,当我针对 mz 配置文件调用 account.GetProfiles 方法时,我收到以下错误消息:

{"error":{"error_code":15,"error_msg":"Access denied: no access to call this method","request_params":[{"key":"oauth","value":"1"},{"key":"method","value":"account.getProfileInfo"},{"key":"uid","value":"430334214"}]}}

我的查询代码如下:

String  getProfile = "https://api.vk.com/method/account.getProfileInfo?uid="+userID+"&access_token="+oauth2Token;
URL profile = new URL(getProfile);
HttpURLConnection connection = (HttpURLConnection) profile .openConnection();
System.out.println("/#/Debug: "+profile .toString());
connection.setRequestMethod("GET");
int responseCode = connection.getResponseCode();

有人有想法吗?不幸的是,网上的英文并不多……我已经挣扎了一个多小时试图弄清楚这个…… 如果我只是调用getProfiles 方法,一切都像一个魅力,但我想获得更多的数据......

干杯

【问题讨论】:

    标签: java api vk


    【解决方案1】:

    您需要获取服务访问密钥才能对 account.GetProfiles 进行查询。点击链接:

    https://vk.com/dev
    

    选择“我的应用程序”->“设置”项并创建您的应用程序令牌。使用“服务令牌”向 VK API 发送请求。

    【讨论】:

    • 不幸的是它不起作用。我将它作为请求中的附加参数传递,相同的错误消息仍然存在...
    • 阅读有关调用此方法的更多信息:vk.com/dev/account.getProfileInfo,它仅适用于独立应用程序(移动)并且仅通过隐式流。
    猜你喜欢
    • 1970-01-01
    • 2010-12-28
    • 1970-01-01
    • 2014-09-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-10
    • 1970-01-01
    相关资源
    最近更新 更多