Answer the question
In order to leave comments, you need to log in
Why can't get countries api vk?
I get countries like this:
$lang = 0; // russian
$headerOptions = array(
'https' => array(
'method' => "GET",
'header' => "Accept-language: en\r\n" .
"Cookie: remixlang=$lang\r\n"
)
);
$methodUrl = 'https://api.vk.com/method/database.getCountries?v=5.103&need_all=1&count=1000';
$streamContext = stream_context_create($headerOptions);
$json = file_get_contents($methodUrl, false, $streamContext);
print_r($json);
{"error":{"error_code":5,"error_msg":"User authorization failed: no access_token passed.","request_params":[{"key":"v","value":"5.103"},{"key":"need_all","value":"1"},{"key":"count","value":"1000"},{"key":"method","value":"database.getCountries"},{"key":"oauth","value":"1"}]}}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question