D
D
Damir Rysaev2014-07-22 10:47:13
JavaScript
Damir Rysaev, 2014-07-22 10:47:13

VK_API: Question about the users.get method. Why is it returning an error?

When passing parameters, the method returns an error.

Error code 4.
Invalid signature.
Check the correctness of the request signature formation: https://vk.com/dev/api_nohttps


Without parameters, the code returns id, first_name, last_name.

VK.init(function() {
    VK.api("users.get", "{user_ids : '1'}", function(data) {
      id = data['response']['0']['id'];
      first_name = data['response']['0']['first_name'];
      last_name = data['response']['0']['last_name'];
      alert(id);
    });	
  }, function() {
    alert('Ошибка при инициализации VK.API');
  }, '5.8');

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
maddog670, 2014-07-22
@freepad

VK.api("users.get", {user_ids:"1"}, function(data) { 
   alert(data.response.id);
});

R
Roman Zhak, 2014-07-22
@romanzhak

VK.api("users.get", {user_ids : 1} //... кавычки уберите

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question