Send Group message
How to create a WhatsApp group or send messages to the group
How to create a group via API
Example usage for WhatsApp API using PHP

Last updated
How to create a WhatsApp group or send messages to the group

Last updated
const BASE_URL = 'https://gate.whapi.cloud/';
$token = 'bg3FeZJ6jWGw32goN02PRnkKO7k03GtX'; // Specify your channel token here
$data = array (
'to' => '[email protected]',
'body' => 'Hello, world!',
'typing_time' => 0,
'view_once' => true,
);
$data = json_encode($data);
$url = BASE_URL . 'messages/text';
$options = array('http' => array(
'method' => 'POST',
'header' => 'Authorization: Bearer '.$token,
'content' => json_encode($data)
));
$context = stream_context_create($options);
$response = file_get_contents($url, false, $context);