K
K
KRHD2018-09-18 08:28:39
In contact with
KRHD, 2018-09-18 08:28:39

How to get what answer was selected in a VK poll with a callback api?

From the call back VK comes such a notification

{"type":"poll_vote_new","object":{"owner_id":-171488291,"poll_id":304961653,"option_id":1026170245,"user_id":211334455},"group_id":171488291,"secret":"secrey"}

I get the details of this poll through the poll_id API
$request = $vk->api('polls.getById', array(
  'owner_id' => id группы,
  'poll_id' => '304961653',
  'access_token' => токен,
  'v' => 5.73,
));

I get this answer
Array ( [0] => Array ( [id] => 1026170245 [text] => sssssssss [votes] => 0 [rate] => 0 ) [1] => Array ( [id] => 1026170246 [text] => sssssssssssss [votes] => 1 [rate] => 100 ) [2] => Array ( [id] => 1026170247 [text] => ssssssssss [votes] => 0 [rate] => 0 ) [3] => Array ( [id] => 1026170248 [text] => s [votes] => 0 [rate] => 0 ) [4] => Array ( [id] => 1026170249 [text] => sssssssssss [votes] => 0 [rate] => 0 ) [5] => Array ( [id] => 1026170250 [text] => ssssssssssssss [votes] => 0 [rate] => 0 ) [6] => Array ( [id] => 1026170251 [text] => ssssssssss [votes] => 0 [rate] => 0 ) [7] => Array ( [id] => 1026170252 [text] => sssssssssss [votes] => 0 [rate] => 0 ) [8] => Array ( [id] => 1026170253 [text] => ssssssssssssss [votes] => 0 [rate] => 0 ) [9] => Array ( [id] => 1026170254 [text] => sssssssssssssssssssss [votes] => 0 [rate] => 0 ) )

Now, how do I understand, let's say the option_id that came from the callback, where does it actually stand in the poll?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question