1. Home
  2. Docs
  3. API
  4. Membaca Pesan

Membaca Pesan

Berikut adalah API untukĀ Membaca Pesan Whatsapp

Metode GET :

https://api.wabotapi.com/readMessage?api={yourAPI}&date={2020-01-01}

Contoh Code :

<?php
    $result = file_get_content("https://api.wabotapi.com/readMessage?api=xxxxxxxxxx&date=2020-01-01")
    if ($result) {
        print_r($result);
    }
?>

Output :

{
   "status":"success",
   "code":"0002",
   "message_detail":{
      "message_id":"1",
      "message_number":"628111111111",
      "message_text":"Test",
      "message_date":"2020-01-01 20:14:21"
   }
}

Metode POST :

https://api.wabotapi.com/readMessage

Parameter :
api: API Anda.
date: Tanggal Pesan

Contoh Code :

<?php
    $curl = curl_init();
    $url = "https://api.wabotapi.com/readMessage";
    $api = "xxxxxxxxxx";
    $date = '2020-01-01';
    
    $data = [
        'api' => $api,
        'date' => $date
    ];

    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":"0002",
   "message_detail":{
      "message_id":"1",
      "message_number":"628111111111",
      "message_text":"Test",
      "message_date":"2020-01-01 20:14:21"
   }
}
Was this article helpful to you? Yes No

How can we help?