Answer the question
In order to leave comments, you need to log in
PHP: how to automatically add posts to the VKontakte community wall?
There is a site on puff (yii). The site has a group in contact. We need the ability to leave posts on the group wall from our server. ON behalf of a group or, if necessary, a special user.
The problem is that I can't login.
$res = file_get_contents('https://oauth.vk.com/access_token?client_id='.$clientId.'&client_secret='.$secret.'&grant_type=client_credentials');
$token = json_decode($res, true)['access_token'];
Answer the question
In order to leave comments, you need to log in
Everything turned out to be simple. Make a request via curl and save the cookies that the server issues. Then everything works.
You can get a token once by writing the link manually with the necessary scope and add offline there.
You can use the received token for an unlimited amount of time.
Here is a detailed description dudev.ru/blog/20_styena-vk.html
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question