Berikut adalah API untukĀ Mengirim Pesan Whatsapp
Metode GET :
https://api.wabotapi.com/sendMessage?api={yourAPI}&phone={phoneNumber}&text={your text}
Contoh Code :
<?php $result = file_get_content("https://api.wabotapi.com/sendMessage?api=xxxxxxxxxx&phone=62811111111&text=yourtext") if ($result) { print_r($result); } ?>
Output :
{ "status":"success", "code":"0001", "message":"Message has entered the queue", "phone":"62811111111", "text":"yourtext" }
Metode POST :
https://api.wabotapi.com/sendMessage
Parameter :
api: API Anda.
phone: Nomor Whatsapp Tujuan.
text: Pesan anda.
Contoh Code :
<?php $curl = curl_init(); $url = "https://api.wabotapi.com/sendMessage"; $api = "xxxxxxxxxx"; $phone = '62811111111'; $text = 'Your message'; $data = [ 'api' => $api, 'phone' => $phone, 'text' => $text ]; 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, $url); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); $result = curl_exec($curl); curl_close($curl); print_r($result); ?>
Output :
{ "status":"success", "code":"0001", "message":"Message has entered the queue", "phone":"62811111111", "text":"Your message" }