L
L
lexstile2018-07-06 18:36:03
PHP
lexstile, 2018-07-06 18:36:03

How to post a post via vk api?

You need to post in a group where I am the owner on behalf of the group. What parameters to send?
Wanted through: https://github.com/fdcore/vk.api
It turns out only on my wall.

$config['secret_key'] = 'secret_key';
$config['client_id'] = 111111111;
$config['owner_id'] = -1111111111;
$config['access_token'] = 'token';
$v = new Vk($config);
$response = $v->api('wall.post', array(
    'message' => 'Тест'
));

This code is published on the profile wall.
Although I specify the group id with the "-" sign

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
ymer, 2018-07-07
@lexstile

$v->api('wall.post', array(
    'owner_id' => 1, // wall id. < 0 - communities.
    'message' => 'Тест'
));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question