$token = '1xmrd7YHjff5';
$array = [
[
'chatId' => '79999999999@c.us', // Recipient's phone number
'message' => 'Привет! Как дела?', // Message
],
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://app.api-messenger.com/sendmessage?token=' . $token);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($array));
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json; charset=utf-8'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
$result = curl_exec($ch); // We will send a request
curl_close($ch);
$data = json_decode($result, true); // Parse the received JSON into an array
echo $data['status'] . ': ' . $data['message'];
Receive incoming messages
$token = '1xmrd7YHjff5';
$url = 'https://app.api-messenger.com/messages?new=1&token=' . $token;
$result = file_get_contents($url); // We will send a request
$data = json_decode($result, true); // Parse the received JSON into an array
foreach ($data['messages'] as $message) { // Print each message
echo 'Sender: ' . preg_replace('~\D+~', '', $message['sender']);
echo 'Message: ' . $message['body'];
}
Install Webhook
Receive notifications about private and group messages via incoming http requests to your server.
// First, install the webhook according to the documentation.
// for example at http://you.site/incoming_message.php
// Decode the JSON that came over the webhook.
$data = json_decode(file_get_contents('php://input'), true);
foreach($data['messages'] as $message) {
// Process each message here already:
// Add to the database or answer right away
}
In real time
The graph shows how many requests to API per second
whatsapp business api,подключение whatsapp business api,whatsapp business api цена,whatsapp business api стоимость,whatsapp business api как подключить,whatsapp бизнес api,facebook whatsapp api,whatsapp бот api,twilio whatsapp api,сколько стоит whatsapp business api,whatsapp cloud api,whatsapp business api рассылка,интеграция whatsapp business api,whatsapp business api waba,официальный whatsapp business api,whatsapp api интеграция,green api whatsapp,whatsapp business api получить,business account whatsapp api,whatsapp business api скачать на андроид,whatsapp business cloud api,green api whatsapp proxy,green api whatsapp отзывы,meta api whatsapp,meta whatsapp cloud api,как получить доступ к api whatsapp bisnes,сервис whatsapp business api