Answer the question
In order to leave comments, you need to log in
Connecting Callback api VK The server returned an incorrect response: HTTP response code said error?
I'm making a simple bot to learn. You need to connect callback api. I downloaded a small bot here . I put my token and string, but the error is "The server returned the wrong response: HTTP response code said error". Referring to index.php
Answer the question
In order to leave comments, you need to log in
Solved a problem.
Paste this code.
<?php
if (!isset($_REQUEST)) {
return;
}
//Строка для подтверждения адреса сервера из настроек Callback API
$confirmation_token = 'хххххххх';
//Ключ доступа сообщества
$token = 'xxx';
//Получаем и декодируем уведомление
$data = json_decode(file_get_contents('php://input'));
//Проверяем, что находится в поле "type"
switch ($data->type) {
//Если это уведомление для подтверждения адреса...
case 'confirmation':
//...отправляем строку для подтверждения
echo $confirmation_token;
break;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question