We assume that your whatsApp account is connected to be able to send messages.
If you haven’t made an account connection, “How to connect WhatsApp account?” review out the tutorial
We will use the “SendMessage” endpoint to send messages
Required parameters:
Our request code will look like this
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => “https://intobo-whatsapp-api1.p.rapidapi.com/SendMessage/14585”,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_ENCODING => “”,
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => “POST”,
CURLOPT_POSTFIELDS => “{\r
"to_number”: “919677713222”,\r
"message_text": “hello world!”\r
}",
CURLOPT_HTTPHEADER => [
“X-RapidAPI-Host: intobo-whatsapp-api1.p.rapidapi.com”,
“X-RapidAPI-Key: YOUR_API_KEY”,
“content-type: application/json”
],
]);
curl);
curl_close($curl);
API Response looks like this
{
“status”: “success”,
“message”: “Message queued successfully.”,
“message_id”: “145861670527682”
}
You can query the status of the message using the “GetMessage” endpoint with the message_id parameter.