4

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

f-CJ
  • 4,235
  • 2
  • 30
  • 28
Spade Johnsson
  • 522
  • 2
  • 7
  • 23

1 Answers1

0

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.

Dmitry Maslennikov
  • 338
  • 2
  • 8
  • 22
  • Unfortunately it doesn't work. I passed it as an aditional parameter in the request, same error message persists... – Spade Johnsson Jun 29 '17 at 09:18
  • Read more about calling this method: https://vk.com/dev/account.getProfileInfo, It works only for Standalone applications (mobile) and only through Implicit Flow. – Dmitry Maslennikov Jun 29 '17 at 11:47