Skip to main content

REST API

SDK Library#

Jika anda kesulitan menggunakan RAW REST API, anda bisa menggunakan Library yang kami telah sediakan pada di link dibawah ini:

Catatan Penting Sebelum Memulai#

  • Di sini kami tidak memberikan full nama url API Endpoint / API URL, sebagai gantinya kami mengganti menjadi example.com
  • Ketika anda berlangganan produk Whatsapp Gateway kami, kami akan memberikan FULL URL Login Panel beserta URL API Endpointnya, ganti example.com sesuai alamat API Endpoint yang kami berikan
  • Pastikan untuk mengganti data sesuai data yang benar, seperti :
    • YOUR-TOKEN-HERE
    • YOUR-DEVICE-ID
    • YOUR-WHATSAPP-NUMBER
  • Jika anda tidak mengetahui TOKEN dan DEVICE-ID, silahkan cek email detail whatsapp kami pada bagian "[PENTING] Penggunaan Whatsapp Gateway dan REST API" atau jika anda sedang melakukan trial, TOKEN dan DEVICE-ID kami lampirkan langsung pada detail trial beserta URL API Endpoint.

Api End Point#

  • /api/v1

Send Message#

Kirim pesan ke nomor whatsapp.

POST /message/send

Request Header#

NameValueType
Acceptapplication/jsonrequired
AuthenticationBearer YOUR-TOKEN-HERErequired

Request Body#

NameValueType
deviceidYour Device IDrequired
numberWhatsapp Number Destionationrequired
messageYour Messagerequired

Responses#

{    "code": 200,    "message": "success, message will be send in background."}

Example Send Message#

  • Curl
curl -s \    -X POST \    -H "Accept: application/json" \    -H "Authorization: Bearer YOUR-TOKEN-HERE" \    -d "deviceid=YOUR-DEVICE-ID" \    -d "number=YOUR-WHATSAPP-NUMBER" \    -d "message=hai ini hanya test" \    https://example.com/api/v1/message/send
  • PHP
<?php
$postData = array(    'deviceid' => 'YOUR-DEVICE-ID',    'number' => '08xxxxxxxxx',    'message' => 'hai ini hanya test',);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://example.com/api/v1/message/send');curl_setopt($ch, CURLOPT_POST, 1);curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData));curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$headers = array();$headers[] = 'Accept: application/json';$headers[] = 'Authorization: Bearer YOUR-TOKEN-HERE';curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);if (curl_errno($ch)) {    echo 'Error:' . curl_error($ch);}curl_close($ch);
print_r($result);

Send Bulk Message#

Kirim pesan whatsapp ke banyak nomor.

POST /message/sendbulk

Request Header#

NameValueType
Acceptapplication/jsonrequired
AuthenticationBearer YOUR-TOKEN-HERErequired

Request Body#

NameValueType
deviceidYour Device IDstring
numberMultiple Whatsapp Number Destionationarray
messageYour Messagestring

Responses#

{    "code": 200,    "message": "success, all message in waiting list."}

Example Send Bulk Message#

  • Curl
curl -s \    -X POST \    -H "Accept: application/json" \    -H "Authorization: Bearer YOUR-TOKEN-HERE" \    -d '{"deviceid": "YOUR-DEVICE-ID", "number": [ 08xxxxxxxxx1, 08xxxxxxxxx2 ], "message": "hai ini hanya test"}' \    https://example.com/api/v1/message/sendbulk
  • PHP
<?php
$postData = array(    'deviceid' => 'YOUR-DEVICE-ID',    'number' => array(        '08xxxxxxxxx1', '08xxxxxxxxx2',    ),    'message' => 'hai ini hanya test',);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://example.com/api/v1/message/sendbulk');curl_setopt($ch, CURLOPT_POST, 1);curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData));curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$headers = array();$headers[] = 'Accept: application/json';$headers[] = 'Authorization: Bearer YOUR-TOKEN-HERE';curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);if (curl_errno($ch)) {    echo 'Error:' . curl_error($ch);}curl_close($ch);
print_r($result);

Send Message to Group#

Kirim pesan whatsapp ke group.

POST /message/sendgroup/{groupID}

Request Header#

NameValueType
Acceptapplication/jsonrequired
AuthenticationBearer YOUR-TOKEN-HERErequired

Request Body#

NameValueType
deviceidYour Device IDstring
groupIDContact Group ID.string
messageYour Messagestring

Responses#

{    "code": 200,    "message": "success, all message in waiting list."}

Example Send Message to Group#

  • Curl
curl -s \    -X POST \    -H "Accept: application/json" \    -H "Authorization: Bearer YOUR-TOKEN-HERE" \    -d '{"deviceid": "YOUR-DEVICE-ID", "message": "hai ini hanya test"}' \    https://example.com/api/v1/sendgroup/{groupID}
  • PHP
<?php
$postData = array(    'deviceid' => 'YOUR-DEVICE-ID',    'message' => 'hai ini hanya test',);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://example.com/api/v1/message/sendgroup/{groupID}');curl_setopt($ch, CURLOPT_POST, 1);curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData));curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$headers = array();$headers[] = 'Accept: application/json';$headers[] = 'Authorization: Bearer YOUR-TOKEN-HERE';curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);if (curl_errno($ch)) {    echo 'Error:' . curl_error($ch);}curl_close($ch);
print_r($result);
Last updated on