I am trying to get comments on the wall post via API Vkontakte.
Php code:
$curl = curl_init(); curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_URL, 'https://api.vk.com/method/wall.getComments'); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, ['count'=>'100', 'post_id'=>$postid, 'version'=>'5.59', 'owner_id'=>"-$ownerid", 'need_likes'=>1, 'sort'=>'asc', 'extended'=>1]); $out = curl_exec($curl); curl_close($curl); echo $out; } For some reason, it displays an error, supposedly I am using the old version of the API:
{"error": {"error_code": 100, "error_msg": "request_params": [{"key": "oauth", "value": "1"}, {"key": "method", "value": "wall.getComments"}, {"key": "count", "value": "100"}, {"key ":" post_id "," value ":" 48820 "}, {" key ":" version "," value ":" 5.59 "}, {" key ":" owner_id "," value ":" - 112461268 " }, {"key": "need_likes", "value": "1"}, {"key": "sort", "value": "asc"}, {"key": "extended", "value" :"one"}]}}
I also tried to transfer the value of 'version' => '5.0', but I also get an error.
How to be?
'version'=>'5.59', but'v'=>'5.59'- Alexey Shimansky