VK API java sdk account.getProfiles访问被拒绝?
发布时间:2020-12-15 02:19:28 所属栏目:Java 来源:网络整理
导读:我正在玩VK API,并设置一个应用程序,并设置到目前为止我需要的一切. 但是,当我针对mz配置文件调用account.GetProfiles方法时,我收到以下错误消息: {"error":{"error_code":15,"error_msg":"Access denied: no access to call this method","request_params"
我正在玩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(); 有人有想法吗?不幸的是,网上用英语并不多……而且我一直在努力争取这一个…… 干杯 解决方法
您需要获取服务访问密钥才能对account.GetProfiles进行查询.点击链接:
https://vk.com/dev 选择“我的应用”项目 – > “设置”并创建您的应用程序令牌.使用“服务令牌”将请求发送到VK API. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |