简体   繁体   中英

VK API java sdk account.getProfiles access denied?

I'm playing around with the VK API, and setup an app and have setup everything I need so far. However, when I call the account.GetProfiles method against mz profile, I get the following error message:

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

My code for the query is as follows:

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();

Anyone have an idea? Unfortunately there's not much online in English... And I've been struggling for over an hour trying to figure this one out... if I just call the getProfiles method, all works like a charm, but I want to get more data...

Cheers

You need to get a service access key to make queries to account.GetProfiles. Follow the link:

https://vk.com/dev

Choose an item "My apps" -> "Settings" and create your application tokens. Use "Service token" to send requests to VK API.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM