Dokumentasi API WaResponder

CARA PENGGUNAAN API WA RESPONDER

Ganti kode KEY dengan milik Anda yang  bisa di lihat di member area app.waresponder.co.id

Silahkan gunakan token untuk memakai fitur API. Hati-hati dengan key anda karena WaResponder tidak bertanggung jawab apabila key diketahui orang lain. Jika anda merasa key diketahui orang silahkan kontak CS untuk request ganti KEY

1. Kirim pesan
“Apa Kabar”
ke nomor 087884494009.
2. Kirim pesan
“Apa Kabar?
Apakah penjualan produk sudah melebihi target?”
ke nomor 087884494009.

Kode PHP 1
$message = “Apa Kabar”;
$phone_no = “087884494009”;

$message = preg_replace( “/(\n)/”, “”, $message );
$message = preg_replace( “/(\r)/”, “”, $message );

$phone_no = preg_replace( “/(\n)/”, “,”, $phone_no );
$phone_no = preg_replace( “/(\r)/”, “”, $phone_no );

$data = array(“phone_no” => $phone_no, “key” => “3097d63400739b70125f42f2e94dc53109fe12f72d830xxx”, “message” => $message);
$data_string = json_encode($data);
$ch = curl_init(‘http://116.203.92.59/api/send_message’);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “POST”);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
‘Content-Type: application/json’,
‘Content-Length: ‘ . strlen($data_string))
);
$result = curl_exec($ch);
?>

Kode PHP 2
<?
$message = “Apa Kabar?\nApakah penjualan produk sudah melebihi target?”;
$phone_no = “087884494009”;

$message = preg_replace( “/(\n)/”, “”, $message );
$message = preg_replace( “/(\r)/”, “”, $message );

$phone_no = preg_replace( “/(\n)/”, “,”, $phone_no );
$phone_no = preg_replace( “/(\r)/”, “”, $phone_no );

$data = array(“phone_no” => $phone_no, “key” => “3097d63400739b70125f42f2e94dc53109fe12f72d830xxx”, “message” => $message);
$data_string = json_encode($data);
$ch = curl_init(‘http://116.203.92.59/api/send_message’);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “POST”);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
‘Content-Type: application/json’,
‘Content-Length: ‘ . strlen($data_string))
);
$result = curl_exec($ch);
?>

1. Kirim pesan
“Apa Kabar”
ke nomor 087884494009.
2. Kirim pesan
“Apa Kabar?
Apakah penjualan produk sudah melebihi target?”
ke nomor 087884494009.

Kode PHP 1
$message = “Apa Kabar”;
$phone_no = “087884494009”;

$message = preg_replace( “/(\n)/”, “”, $message );
$message = preg_replace( “/(\r)/”, “”, $message );

$phone_no = preg_replace( “/(\n)/”, “,”, $phone_no );
$phone_no = preg_replace( “/(\r)/”, “”, $phone_no );

$data = array(“phone_no” => $phone_no, “key” => “3097d63400739b70125f42f2e94dc53109fe12f72d830xxx”, “message” => $message);
$data_string = json_encode($data);
$ch = curl_init(‘http://116.203.92.59/api/send_message_split’);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “POST”);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
‘Content-Type: application/json’,
‘Content-Length: ‘ . strlen($data_string))
);
$result = curl_exec($ch);
?>

Kode PHP 2
<?
$message = “Apa Kabar?\nApakah penjualan produk sudah melebihi target?”;
$phone_no = “087884494009”;

$message = preg_replace( “/(\n)/”, “”, $message );
$message = preg_replace( “/(\r)/”, “”, $message );

$phone_no = preg_replace( “/(\n)/”, “,”, $phone_no );
$phone_no = preg_replace( “/(\r)/”, “”, $phone_no );

$data = array(“phone_no” => $phone_no, “key” => “3097d63400739b70125f42f2e94dc53109fe12f72d830xxx”, “message” => $message);
$data_string = json_encode($data);
$ch = curl_init(‘http://116.203.92.59/api/send_message_split’);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “POST”);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
‘Content-Type: application/json’,
‘Content-Length: ‘ . strlen($data_string))
);
$result = curl_exec($ch);
?>

1. Kirim pesan
“Apa Kabar”
ke group Arisan Kita.
2. Kirim pesan
“Apa Kabar?
Apakah penjualan produk sudah melebihi target?”
ke group Arisan Kita.

Kode PHP 1
$message = “Apa Kabar”;
$group_name = “Arisan Kita”;

$message = preg_replace( “/(\n)/”, “”, $message );
$message = preg_replace( “/(\r)/”, “”, $message );

$group_name = preg_replace( “/(\n)/”, “,”, $group_name );
$group_name = preg_replace( “/(\r)/”, “”, $group_name );

$data = array(“group_name” => $group_name, “key” => “3097d63400739b70125f42f2e94dc53109fe12f72d830xxx”, “message” => $message);
$data_string = json_encode($data);
$ch = curl_init(‘http://116.203.92.59/api/send_group’);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “POST”);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
‘Content-Type: application/json’,
‘Content-Length: ‘ . strlen($data_string))
);
$result = curl_exec($ch);
?>

Kode PHP 2
<?
$message = “Apa Kabar?\nApakah penjualan produk sudah melebihi target?”;
$group_name = “Arisan Kita”;

$message = preg_replace( “/(\n)/”, “”, $message );
$message = preg_replace( “/(\r)/”, “”, $message );

$group_name = preg_replace( “/(\n)/”, “,”, $group_name );
$group_name = preg_replace( “/(\r)/”, “”, $group_name );

$data = array(“group_name” => $group_name, “key” => “3097d63400739b70125f42f2e94dc53109fe12f72d830xxx”, “message” => $message);
$data_string = json_encode($data);
$ch = curl_init(‘http://116.203.92.59/api/send_group’);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “POST”);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
‘Content-Type: application/json’,
‘Content-Length: ‘ . strlen($data_string))
);
$result = curl_exec($ch);
?>

Upload file gambar dengan full path /home/picture/kirim_gambar.jpg

Kode PHP
$source_file = “/home/picture/kirim_gambar.jpg”;

$ch = curl_init(‘http://116.203.92.59/api/upload/3097d63400739b70125f42f2e94dc53109fe12f72d830xxx’);
$cfile = new CURLFile($source_file,’image/png’,$source_file);
$data = array(‘file’ => $cfile);
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$nama_foto = curl_exec($ch);

?>

Kirim gambar full path /home/picture/kirim_gambar.jpg
ke nomor 087884494009.
Untuk mengirim pesan gambar file gambar harus di upload terlebih dahulu.

Kode PHP
$filename = “kirim_gambar.jpg”;
$phone_no = “087884494009”;

$phone_no = preg_replace( “/(\n)/”, “,”, $phone_no );
$phone_no = preg_replace( “/(\r)/”, “”, $phone_no );

$data = array(“phone_no” => $phone_no, “key” => “3097d63400739b70125f42f2e94dc53109fe12f72d830xxx”, “filename” => $filename);
$data_string = json_encode($data);
$ch = curl_init(‘http://116.203.92.59/api/send_image’);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “POST”);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
‘Content-Type: application/json’,
‘Content-Length: ‘ . strlen($data_string))
);
$result = curl_exec($ch);
?>

Kirim gambar full path /home/picture/kirim_gambar.jpg. Dengan Pesan
“Apa kabar?
Apakah penjualan produk sudah melebihi target?”
ke nomor 087884494009.
Apabila ada baris baru (new line) maka diganti dengan kata “”

Kode Python
from requests import post
post(‘http://116.203.92.59/api/send_image’, json = {“key” : “3097d63400739b70125f42f2e94dc53109fe12f72d830xxx”, “filename”: “kirim_gambar.jpg”, “phone_no” : “087884494009”, “message” : “Apa Kabar?Apakah penjualan produk sudah melebihi target?”})

Kirim gambar dengan url https://www.nascondimi.com/images/logo_not_dark.png. Dengan Pesan
“Apa kabar?
Apakah penjualan produk sudah melebihi target?”
ke nomor 087884494009.

Kode PHP
$message = “Apa Kabar\nApakah penjualan produk sudah melebihi target?”;
$url = “https://www.nascondimi.com/images/logo_not_dark.png”;
$phone_no = “087884494009”;

$message = preg_replace( “/(\n)/”, “”, $message );
$message = preg_replace( “/(\r)/”, “”, $message );

$phone_no = preg_replace( “/(\n)/”, “,”, $phone_no );
$phone_no = preg_replace( “/(\r)/”, “”, $phone_no );

$data = array(“phone_no” => $phone_no, “key” => “3097d63400739b70125f42f2e94dc53109fe12f72d830xxx”, “url” => $url, “message” => $message);
$data_string = json_encode($data);
$ch = curl_init(‘http://116.203.92.59/api/send_image_url’);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “POST”);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
‘Content-Type: application/json’,
‘Content-Length: ‘ . strlen($data_string))
);
$result = curl_exec($ch);
?>

Kirim gambar dengan url https://www.nascondimi.com/images/logo_not_dark.png. Dengan Pesan
“Apa kabar?
Apakah penjualan produk sudah melebihi target?”
ke nomor 087884494009.

Kode PHP
$message = “Apa Kabar\nApakah penjualan produk sudah melebihi target?”;
$url = “https://www.nascondimi.com/images/logo_not_dark.png”;
$phone_no = “087884494009”;

$message = preg_replace( “/(\n)/”, “”, $message );
$message = preg_replace( “/(\r)/”, “”, $message );

$phone_no = preg_replace( “/(\n)/”, “,”, $phone_no );
$phone_no = preg_replace( “/(\r)/”, “”, $phone_no );

$data = array(“phone_no” => $phone_no, “key” => “3097d63400739b70125f42f2e94dc53109fe12f72d830xxx”, “url” => $url, “message” => $message);
$data_string = json_encode($data);
$ch = curl_init(‘http://116.203.92.59/api/send_image_url_no_upload’);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “POST”);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
‘Content-Type: application/json’,
‘Content-Length: ‘ . strlen($data_string))
);
$result = curl_exec($ch);
?>

Upload file apa saja dengan full path /home/burkass/Downloads/Emailing Surat Sakit.pdf

Kode PHP
$source_file = “/home/burkass/Downloads/Emailing Surat Sakit.pdf”;

$ch = curl_init(‘http://116.203.92.59/api/file_upload/3097d63400739b70125f42f2e94dc53109fe12f72d830xxx’);
$cfile = new CURLFile($source_file,’file’,$source_file);
$data = array(‘file’ => $cfile);
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$nama_file = curl_exec($ch);

?>

Kirim file apa saja /home/burkass/Downloads/Emailing Surat Sakit.pdf
ke nomor 087884494009.
Untuk mengirim pesan file harus di upload terlebih dahulu.

Kode PHP
$filename = “/home/burkass/Downloads/Emailing Surat Sakit.pdf”;
$phone_no = “087884494009”;

$phone_no = preg_replace( “/(\n)/”, “,”, $phone_no );
$phone_no = preg_replace( “/(\r)/”, “”, $phone_no );

$data = array(“phone_no” => $phone_no, “key” => “3097d63400739b70125f42f2e94dc53109fe12f72d830xxx”, “filename” => $filename);
$data_string = json_encode($data);
$ch = curl_init(‘http://116.203.92.59/api/send_file’);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “POST”);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
‘Content-Type: application/json’,
‘Content-Length: ‘ . strlen($data_string))
);
$result = curl_exec($ch);
?>

Kirim gambar berupa file url https://www.nascondimi.com/images/logo_not_dark.png. Kode PHP
$url = “https://www.nascondimi.com/images/logo_not_dark.png”;
$phone_no = “087884494009”;

$phone_no = preg_replace( “/(\n)/”, “,”, $phone_no );
$phone_no = preg_replace( “/(\r)/”, “”, $phone_no );

$data = array(“phone_no” => $phone_no, “key” => “3097d63400739b70125f42f2e94dc53109fe12f72d830xxx”, “url” => $url);
$data_string = json_encode($data);
$ch = curl_init(‘http://116.203.92.59/api/send_file_url’);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, “POST”);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
‘Content-Type: application/json’,
‘Content-Length: ‘ . strlen($data_string))
);
$result = curl_exec($ch);
?>