3

I use VK Android SDK (com.perm.kate.api) https://bitbucket.org/ruX/android-vk-sdk/overview

The last line of the code i provide below one day began returning KException.

From the documentation: If some sort of action is completed too often, then the request to API may return the error "Captcha needed". The user will need to enter a code from the image and send the request again with the entered Captcha code in the request parameters:

  • captcha_sid - captcha identifier captcha_img
  • link to the image thatshould be shown to the user so that they can enter the text from the image.

The question is where should I enter this parameters? I use the method to get user profile which doesn't contain these arguments:

public ArrayList<User> getProfiles(Collection<Long> uids, Collection<String> domains, String fields, String name_case) throws MalformedURLException, IOException, JSONException, KException

The code to get a user profile:

Api vkApi=new Api(account.access_token, Constants.API_ID);
//get user
Collection<Long>userIds=new ArrayList<Long>();
userIds.add(account.user_id);
ArrayList<User> users=vkApi.getProfiles(userIds, null, null, null); //KException
ozahorulia
  • 9,798
  • 8
  • 48
  • 72
Alexey
  • 7,127
  • 9
  • 57
  • 94

1 Answers1

1

You need to set all parameters. Not null but array with empty string, and empty string. My example:

Collection<Long> u = new ArrayList<Long>();
u.add(user_id);
Collection<String> d = new ArrayList<String>();
d.add("");

response = vkApi.getProfiles(u, d, "", "", "", "");
r4ge
  • 386
  • 3
  • 13