SendText is an API that allows you to send text messages to WhatsApp numbers.
Endpoint : https://sms.wab24.xyz/api/send-message
Method : POST
Download Example PHP : Download
Array Body
{
"api_key" => "9f4ff928dd69d9c26c7a0c6b086618b63ffae3b4",
"receiver" => "887xxxxxxxx",
"data":{
"message": "Hello World"
}
}
Code Example Curl
curl -X POST \
'https://sms.wab24.xyz/api/send-message' \
--header 'Accept: */*' \
--header 'Content-Type: application/json' \
--data-raw '{
"api_key": "9f4ff928dd69d9c26c7a0c6b086618b63ffae3b4",
"receiver": "628xxxxxxxx",
"data":{
"message": "Hello World"
}
}
Code Example PHP
$body = array(
"api_key" => "9f4ff928dd69d9c26c7a0c6b086618b63ffae3b4",
"receiver" => "628xxxxxxxx",
"data" => array("message" => "Hello World")
);
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sms.wab24.xyz/api/send-message",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode($body),
CURLOPT_HTTPHEADER => [
"Accept: */*",
"Content-Type: application/json",
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
i am using this code but its not working
test(1).aia (2.5 KB)