java - VK API java sdk account.getProfiles 访问被拒绝?

标签 java api vk

我正在尝试使用 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 方法,一切都很顺利,但我想获取更多数据...

干杯

最佳答案

您需要获取服务访问 key 才能查询 account.GetProfiles。点击链接:

https://vk.com/dev

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

关于java - VK API java sdk account.getProfiles 访问被拒绝?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44218429/

相关文章:

java - 如何在 Windows 7 计算机上找到 Java 的下载位置

java - 如何从 Linux 机器使用 java 和 jackcess 访问共享文件夹中的远程 .mdb 文件

java - 如何在发生异常时优雅地关闭 Endpoint?

javascript - 通过 history.pushState 更改页面时如何在 google chrome 扩展程序中插入内容脚本?

android - VkApi。异常

java - (Java)如何改变图片( war 卡牌游戏)

android - 如何在 android 应用程序中使用 foursquare API?

php - 什么是 Real Quickbooks Online API?

javascript - Axios 不在请求中传递 header

android - vkontakte 在 android 中的墙上共享消息?