The Whatsnesia API follows RESTful architecture standards, offering clear and consistent resource-based endpoints. All requests and responses are transmitted in JSON format, leveraging standard HTTP verbs, status codes, and authentication protocols to enable secure, efficient, and scalable integrations.

API Base URL

Please note that Whatsnesia does not provide a sandbox or test environment. All API requests are processed in the live environment, so ensure that all request data and parameters are accurate before making any calls.

string
https://whatsnesia.com/external-api

All requests to the Whatsnesia API require authentication. Each API request must include a valid client-id and client-secret to the request header, which can be obtained from your Whatsnesia Dashboard under Developer Tools.

In addition to credentials, Whatsnesia enforces IP-based security. You must register and enable your server’s public IP address in the IP Whitelist section of the dashboard. Requests originating from non-whitelisted IP addresses will be automatically rejected.

Both valid API credentials and an approved IP address are mandatory. Without completing these two steps, authentication will fail and API access will not be granted.

All responses from the Whatsnesia API are returned in JSON format. Each response follows a consistent structure and includes a status indicator, message, and relevant data payload when applicable. Standard HTTP status codes are used to represent the outcome of each request.

Contoh Respons Berhasil

JSON
{
"status": "success",
"remark": "contact_list",
"message":[
    "Contact list fetched successfully"
],
"data": {
   ...you get all data here
    }
}
                    

Contoh Respons Error

JSON
{
    "remark": "Unauthorized",
    "status": "error",
    "message": [
        "The client secret is required"
    ]
}
                    
JSON
 {
    "remark": "Unauthorized",
    "status": "error",
    "message": [
        "Access to this API endpoint is restricted to IP addresses that have been explicitly whitelisted.",
        "In order to access this API endpoint, please add your IP address (::1) to the white list from the user dashboard."
    ]
}
                    
php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://whatsnesia.com/extern-api/contact/list',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'client-id: YOUR-CLIENT-ID',
    'client-secret: YOUR-CLIENT-SECRET',
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

 
                                
                        
Parameter Query

Parameter query yang memungkinkan Anda menyesuaikan respons API.

Nama Deskripsi Wajib Bawaan
halaman Menentukan nomor halaman yang diambil. Tidak 1
paginasi Menentukan jumlah item yang dikembalikan per halaman. Tidak 20
pencarian Mencari kontak berdasarkan nama depan, nama belakang, atau nomor mobile. Tidak -
php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://whatsnesia.com/extern-api/contact/store',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('firstname' => 'John','lastname' => 'Doe','mobile_code' => '880','mobile' => '01988'),
  CURLOPT_HTTPHEADER => array(
    'client-id: YOUR-CLIENT-ID',
    'client-secret: YOUR-CLIENT-SECRET',
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Field Wajib

Field berikut wajib diisi untuk membuat kontak baru di sistem.

Nama Wajib Bawaan
nama_depan Ya -
nama_belakang Ya -
kode_mobile Ya -
seluler Ya -
kota Tidak -
provinsi Tidak -
kode_pos Tidak -
alamat Tidak -
gambar_profil Tidak -
php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://whatsnesia.com/extern-api/contact/update/{contactId}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('firstname' => 'John','lastname' => 'Doe','mobile_code' => '880','mobile' => '01988'),
  CURLOPT_HTTPHEADER => array(
    'client-id: YOUR-CLIENT-ID',
    'client-secret: YOUR-CLIENT-SECRET',
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Field Wajib

Field berikut wajib diisi untuk membuat kontak baru di sistem.

Nama Wajib Bawaan
nama_depan Ya -
nama_belakang Ya -
kode_mobile Ya -
seluler Ya -
kota Tidak -
provinsi Tidak -
kode_pos Tidak -
alamat Tidak -
gambar_profil Tidak -
php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://whatsnesia.com/extern-api/contact/delete/{contactId}',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'DELETE',
  CURLOPT_POSTFIELDS => array('firstname' => 'John','lastname' => 'Doe','mobile_code' => '880','mobile' => '01988'),
  CURLOPT_HTTPHEADER => array(
    'client-id: YOUR-CLIENT-ID',
    'client-secret: YOUR-CLIENT-SECRET',
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://whatsnesia.com/extern-api/inbox/conversation-list',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'client-id: YOUR-CLIENT-ID',
    'client-secret: YOUR-CLIENT-SECRET',
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Parameter Query

Nama Deskripsi Bawaan
status Filter percakapan berdasarkan status. Gunakan nilai di bawah untuk memfilter percakapan via status. Done = 1; Pending = 2; Important = 3; Unread = 4; Semua
halaman Menentukan nomor halaman yang diambil. 1
paginasi Menentukan jumlah item yang dikembalikan per halaman. 20
php

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://whatsnesia.com/extern-api/inbox/change-conversation-status/2',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('status' => '1'),
  CURLOPT_HTTPHEADER => array(
    'client-id: YOUR-CLIENT-ID',
    'client-secret: YOUR-CLIENT-SECRET',
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Parameter URL

Param Tipe Deskripsi
conversation_id integer ID unik percakapan

Isi Permintaan

Kolom Tipe Wajib
status integer YEs
php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://whatsnesia.com/extern-api/inbox/conversation-details/2',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_POSTFIELDS => array('status' => '1'),
  CURLOPT_HTTPHEADER => array(
    'client-id: YOUR-CLIENT-ID',
    'client-secret: YOUR-CLIENT-SECRET',
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Parameter URL

Param Tipe Deskripsi
conversation_id integer ID unik percakapan
php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://whatsnesia.com/extern-api/inbox/send-message',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('mobile_code' => '880','mobile' => xxxxxxxxx','message' => 'Hello world'),
  CURLOPT_HTTPHEADER => array(
    'client-id: YOUR-CLIENT-ID',
    'client-secret: YOUR-CLIENT-SECRET',
  ),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;

Isi Permintaan

Kolom Tipe Wajib Deskripsi
mobile_code string yes Kode negara mobile. Harus berupa kode negara numerik yang valid tanpa tanda plus (+).
mobile string yes Nomor ponsel valid yang terkait dengan kode negara yang diberikan.
from_number string conditional Diperlukan nomor WhatsApp Business yang valid dan terdaftar pada akun Anda serta di dashboard Meta. Jika tidak ada ID yang diberikan, pesan akan dikirim menggunakan akun WhatsApp default yang terdaftar.
message string Conditional Isi pesan teks. Wajib jika tidak ada media, lokasi, atau data interaktif yang diberikan
image file No File gambar (jpg, jpeg, png - maks 5MB)
document file No File dokumen (pdf, doc, docx - maks 100MB)
video file No File video (mp4 - maks 16MB)
audio file No File audio - maks 16MB
latitude decimal Conditional Latitude untuk pesan lokasi
longitude decimal Conditional Longitude untuk pesan lokasi
cta_url_id integer No ID URL CTA untuk pesan tombol interaktif
interactive_list_id integer No ID daftar interaktif

Catatan

Setidaknya satu jenis pesan harus disediakan.

Pesan interaktif memerlukan paket aktif.

Kontak yang diblokir tidak dapat mengirim atau menerima pesan.

php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://whatsnesia.com/extern-api/inbox/send-template-message',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => array('mobile_code' => '880','mobile' => 'xxxxxx','testmplate_id' => 'your template id'),
  CURLOPT_HTTPHEADER => array(
    'client-id: YOUR-CLIENT-ID',
    'client-secret: YOUR-CLIENT-SECRET',
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Isi Permintaan

Kolom Tipe Wajib Deskripsi
mobile_code string yes Kode negara mobile. Harus berupa kode negara numerik yang valid tanpa tanda plus (+).
mobile string yes Nomor ponsel valid yang terkait dengan kode negara yang diberikan.
from_number string conditional Diperlukan nomor WhatsApp Business yang valid dan terdaftar pada akun Anda serta di dashboard Meta. Jika tidak ada ID yang diberikan, pesan akan dikirim menggunakan akun WhatsApp default yang terdaftar.
template_id integer Yes ID template WhatsApp yang disetujui

Catatan

Hanya template WhatsApp yang sudah disetujui yang dapat dikirim.

Pesan template biasanya digunakan untuk percakapan yang diprakarsai bisnis.

Kontak yang diblokir tidak dapat menerima pesan template.

Akun WhatsApp harus terhubung sebelum mengirim pesan.

php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://whatsnesia.com/extern-api/inbox/template-list',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'client-id: YOUR-CLIENT-ID',
    'client-secret: YOUR-CLIENT-SECRET',
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;