Ini adalah cara dan format untk hantar mesej jenis “text only” menggunakan API WaBot.
URL – https://api.wabot.my/api/send-message
<?php
$curl = curl_init();
$token = "";
$data = [
'phone' => '081XXXXXXX',
'message' => 'hellow world',
];
curl_setopt($curl, CURLOPT_HTTPHEADER,
array( "Authorization: $token",
) );
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($curl, CURLOPT_URL, "https://api.wabot.my/api/send-message");
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
$result = curl_exec($curl);
curl_close($curl);
echo "<pre>";
print_r($result);
?>
Request Parameters:
- Authorization: device token
- phone: nombor telefon penerima
- message: message yang nak dihantar