Answer the question
In order to leave comments, you need to log in
Why does wall.post stop working after a while?
I receive the token by hand, thus:
1) First
$sRequest = "https://api.vk.com/oauth/authorize?client_id=" . $vkontakteApplicationId . "&scope=offline,wall,groups&redirect_uri=https://vk.com&response_type=code";
$sRequest = "https://oauth.vk.com/access_token?client_id=" . $vkontakteApplicationId . "&client_secret=" . $vkontakteApplicationSecret . "&redirect_uri=https://vk.com&code=" . $code;
$sRequest = "https://api.vk.com/method/wall.post?owner_id=" . $ownerID . "&from_group=1&access_token=" . $accessToken ."&signed=" . $signed . "&v=5.80";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $sRequest);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "message= $message");
$r = curl_exec($ch);
curl_close($ch);
var_dump($r);
Answer the question
In order to leave comments, you need to log in
In general, I wrote to vk.com support - they fixed it, now it works and nothing needs to be fixed.
That's right, the token has a lifetime. As soon as it is expired, you need to get it again.
If you manage to get it by hand, then why can't you send a link from php and pull out a token from there? Unfortunately, I won’t tell you the code, I did it in another language. There should be examples of correct work, look
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question