T
T
Tenebrius2016-08-04 23:05:28
PHP
Tenebrius, 2016-08-04 23:05:28

How to send messages to a VKontakte group?

Essence of the question. It is necessary that a script be launched from the server via the crown, take a certain message and send it to the wall in a contact to a certain group.
The wall.post method requires an access_token as I understand it. By conventional means, this token is bound to ip, and does not work for the server.
The code is something like this:

$request_params = array(
  'access_token' => $access_token,
  'owner_id' => $group_id,
  'from_group' => '1',
  'message' => 'Some text.',
  'v' => '5.52'
  );
$get_params = http_build_query($request_params);
$result = json_decode(file_get_contents('https://api.vk.com/method/wall.post?'. $get_params));

How to get this token so that a request is made from the server?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question