I understand with vk api. I want to pull out user information in the fields of games, education, occupation. On the test page on https://vk.com/dev/users.get all fields are returned: what the test form gives

But when I do it via JAVA SDK. Not all fields come: my answer

Here is my code snippet:

String str = vk.users().get(new UserActor(app_id, access_token)) .userIds("5933129") .fields(UserField.EDUCATION, UserField.GAMES, UserField.OCCUPATION) .executeAsString(); System.out.println(str); 

From the documentation I learned that

dock

But I kind of pass the access_token through the UserActor object, or I do not understand something like that. As an access_token I use the 'Service Access Key' which I took from the settings in the personal account of the application.

I tried to execute via the browser:

 https://api.vk.com/method/users.get?user_ids=5933129&fields=games,education,occupation&access_token=xxxxxxx3&v=5.69 

also comes hidden: 1

The question is how to ensure that all fields are returned?

  • The body of your request have the opportunity to see? Pledge and check the parameters. - vp_arth
  • There was such an idea, but I did not find how to query the log. Maybe you know? - Jeremiah Isakov
  • access_token can be obtained through OAuth. In the answer of Victor there is a link to the documentation page. However, I was led here by the fact that the problem remained. - N. Kudryavtsev

1 answer 1

When you make a request through the page https://vk.com/dev/users.get you run it with the user access key.

Apparently the user has hidden the data you are interested in from unauthorized users.

For everything to work fine, you need to get a user access key.