Answer the question
In order to leave comments, you need to log in
How to get Access token in vk API after server authorization?
I'm trying to figure out the VK API. According to the documentation I do server authorization. The contact redirects the user back to me and the GET parameter gives me the code.
As it turned out, that's not all, and I need to somehow get an access_token. To do this, I make a request:
$resp = file_get_contents('https://api.vk.com/oauth/token?client_id='.$api_id.'&code='.$code.'&client_secret='.$secret_key.'&redirect_uri='.$uri);
var_dump($resp);
Answer the question
In order to leave comments, you need to log in
Thanks to all. I tried from another user - the first time everything worked, the second the same error. Apparently, while the old access_token is valid, the new one will not be given to us.
For server authorization (without involving the user through the browser), you need to use a different procedure:
vk.com/dev/auth_server
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question