E
E
exhang2017-03-06 09:41:33
Classmates
exhang, 2017-03-06 09:41:33

Do classmates have webhooks?

For example, VK has webhooks for api groups. It is very convenient for quick moderation of the VK group, the telegram bot sends a notification about any comment or entry, can the same thing be done for a group in classmates?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sasha23rus, 2017-10-02
@sasha23rus

тоже пол дня потерял получаем токен для группы
https://apiok.ru/dev/graph_api/bot_api
далее выполняем код

$tocken = 'ключ';
$url = 'https://api.ok.ru/graph/me/subscribe?access_token='.$tocken;
    $result = file_get_contents($url, false, stream_context_create(array(
        'http' => array(
            'method'  => 'POST',
            'header'  => 'Content-type: application/json',
            'content' => '{"url": "https://твой сайт/webhook.php"}'
        )
    )));
    print_r($result);

если всё прошло удачно увидишь
{"success":true}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question