VK API java sdk account.getProfiles access denied?

I am playing with VK API and setting up the app and setting up whatever I need. However, when I call the account.GetProfiles method against the mz profile, I get the following error:

{"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 request code looks like this:

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 isn't much online in English ... and I've been struggling for over an hour trying to figure it out ... if I just call the getProfiles method everything works like a charm, but I want more data ...

amuses

+3


source to share


1 answer


You need to get the service access token in order to make requests to account.GetProfiles. Follow this link:

https://vk.com/dev

      



Select "My Apps" → "Settings" and create your application tokens. Use the "Service Token" to send requests to the VK API.

0


source







All Articles