我正在尝试使用 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/