1. Home
  2. Docs
  3. API
  4. Mengirim Pesan Text Terjadwal

Mengirim Pesan Text Terjadwal

Berikut adalah API untuk Mengirim Pesan Whatsapp

Metode GET :

https://api.wabotapi.com/sendMessage?api={yourAPI}&phone={phoneNumber}&text={your text}&datetime=2020-01-01 00:00:00

Contoh Code :

<?php
    $result = file_get_content("https://api.wabotapi.com/sendMessage?api=xxxxxxxxxx&phone=62811111111&text=yourtext&datetime=2020-01-01 00:00:00")
    if ($result) {
        print_r($result);
    }
?>

Output :

{
   "status":"success",
   "code":"0001",
   "message":"Message has entered the queue at 2020-01-01 00:00:00",
   "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';
    $datetime = '2020-01-01 00:00:00';

    $data = [
        'api' => $api,
        'phone' => $phone,
        'text' => $text,
        'datetime' => $datetime
    ];

    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 at 2020-01-01 00:00:00",
   "phone":"62811111111",
   "text":"Your message"
}
Was this article helpful to you? Yes No

How can we help?