WA EFO Blast Pro API
REST API ini dirancang untuk integrasi dengan sistem ERP, CRM, atau aplikasi eksternal lainnya. Anda dapat mengirim pesan WhatsApp, mengelola kontak, membuat campaign, dan memantau status pengiriman secara real-time.
https://waefo.my.id/api/v1
JSON
Bearer Token
- Login ke dashboard dan buka menu API Keys
- Klik Generate Key Baru, beri nama, lalu salin key-nya
- Kirim request dengan header
Authorization: Bearer <api-key> - Mulai integrasi — cek saldo dulu dengan endpoint
GET /balance
# Autentikasi
Semua endpoint API memerlukan API Key yang dikirim melalui HTTP Header.
Authorization: Bearer wsofa_a1b2c3d4e5f6...
Cara Mendapatkan API Key
- Login ke dashboard waefo.my.id
- Buka menu API Keys di sidebar
- Klik Generate Key Baru
- Beri nama label (contoh: ERP Toko Online)
- Salin API Key yang muncul — key hanya ditampilkan sekali
API Key yang tidak aktif atau tidak valid akan mengembalikan error 401 Unauthorized. Anda dapat mengaktifkan/nonaktifkan key kapan saja dari dashboard.
# Base URL
Semua request harus menggunakan HTTPS. Base URL untuk semua endpoint:
https://waefo.my.id/api/v1
| Header | Wajib | Nilai |
|---|---|---|
Authorization | Required | Bearer <api-key> |
Content-Type | Required | application/json |
Accept | Optional | application/json |
# Billing & Pricing
Sistem menggunakan model prepaid credits (wa_balance). Setiap pesan WhatsApp yang dikirim melalui API akan dikenakan biaya 1 credit.
Biaya per pesan bersifat dinamis mengikuti kurs USD dan biaya Twilio/Meta. Cek biaya terkini via endpoint GET /balance.
Jika saldo tidak mencukupi, API mengembalikan 402 Payment Required. Top up saldo di halaman Billing dashboard.
# Error Codes
API menggunakan HTTP status codes standar. Setiap error response memiliki struktur JSON yang konsisten.
{
"success": false,
"error": "Deskripsi error",
"code": "ERROR_CODE"
}
| HTTP Status | Code | Keterangan |
|---|---|---|
| 400 | VALIDATION_ERROR | Input tidak valid |
| 401 | AUTH_MISSING_HEADER | Header Authorization tidak ditemukan |
| 401 | AUTH_INVALID_KEY | API Key tidak valid atau tidak aktif |
| 402 | INSUFFICIENT_BALANCE | Saldo wa_balance tidak mencukupi |
| 404 | NOT_FOUND | Resource tidak ditemukan |
| 409 | CONFLICT | Duplikat data |
| 422 | VALIDATION_ERROR | Validasi input gagal |
| 500 | INTERNAL_ERROR | Error internal server |
| 502 | BAD_GATEWAY | Gagal mengirim ke Twilio |
# Cek Saldo
Response (200)
curl -H "Authorization: Bearer wsofa_your_api_key" \ -H "Content-Type: application/json" \ https://waefo.my.id/api/v1/balance
# Kirim Pesan Tunggal
Request Body
| Field | Type | Required | Deskripsi |
|---|---|---|---|
to | string | Ya | Nomor tujuan (08xx / 62xx / +62xx) |
body | string | Ya | Isi pesan |
media_url | string | Tidak | URL gambar/file (opsional) |
Contoh Request
Response (200)
curl -X POST \ -H "Authorization: Bearer wsofa_your_api_key" \ -H "Content-Type: application/json" \ -d '{"to":"6281234567890","body":"Halo dari ERP!"}' \ https://waefo.my.id/api/v1/messages/send
# Kirim Massal
Request Body
| Field | Type | Required | Deskripsi |
|---|---|---|---|
messages | array | Ya | Array objek pesan (max 1000) |
messages[].to | string | Ya | Nomor tujuan |
messages[].body | string | Ya | Isi pesan |
messages[].media_url | string | Tidak | URL media |
Contoh Request
Response (200)
# Daftar Pesan
Query Parameters
| Parameter | Type | Deskripsi |
|---|---|---|
limit | int | Jumlah per halaman (default: 50, max: 200) |
offset | int | Halaman (default: 0) |
status | string | Filter: sent, delivered, read, failed |
date_from | string | Filter awal (YYYY-MM-DD HH:MM:SS) |
date_to | string | Filter akhir (YYYY-MM-DD HH:MM:SS) |
# Detail Pesan
Response (200)
# Daftar Kontak
Query Parameters
| Parameter | Type | Deskripsi |
|---|---|---|
limit | int | Jumlah per halaman (default: 50) |
offset | int | Halaman |
search | string | Cari nama, telepon, atau email |
# Tambah Kontak
Request Body
| Field | Type | Required | Deskripsi |
|---|---|---|---|
name | string | Ya | Nama kontak |
phone | string | Ya | Nomor telepon |
email | string | Tidak | |
city | string | Tidak | Kota |
tags | string | Tidak | Tags (pisahkan koma) |
Contoh Request
Response (201 Created)
# Daftar Campaign
| Parameter | Type | Deskripsi |
|---|---|---|
limit | int | Jumlah per halaman (default: 50) |
offset | int | Halaman |
# Detail Campaign
Response (200)
# Buat Campaign
Request Body
| Field | Type | Required | Deskripsi |
|---|---|---|---|
name | string | Ya | Nama campaign |
template_id | int | Ya | ID template pesan |
segment_id | int | Ya | ID segment kontak |
schedule_at | string | Tidak | Jadwal kirim (YYYY-MM-DD HH:MM:SS) |
# Daftarkan Webhook Callback
Request Body
| Field | Type | Required | Deskripsi |
|---|---|---|---|
url | string | Ya | URL endpoint ERP (harus HTTPS) |
Contoh Request
Webhook Payload (POST ke URL Anda)
Setiap kali status pesan berubah, sistem akan mengirim POST request ke URL yang didaftarkan:
Pastikan endpoint ERP Anda mengembalikan HTTP 200 dalam 5 detik. Webhook URL berlaku per API Key.
# Contoh Integrasi
Contoh kode untuk berbagai bahasa pemrograman.
PHP
<?php $apiKey = 'wsofa_your_api_key_here'; $baseUrl = 'https://waefo.my.id/api/v1'; function apiRequest($method, $endpoint, $data = null) { global $apiKey, $baseUrl; $ch = curl_init($baseUrl . $endpoint); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => $method, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer ' . $apiKey, 'Content-Type: application/json', ], ]); if ($data) { curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); } $response = curl_exec($ch); curl_close($ch); return json_decode($response, true); } // Cek saldo $balance = apiRequest('GET', '/balance'); echo "Saldo: " . ($balance['data']['wa_balance'] ?? 0); // Kirim pesan $result = apiRequest('POST', '/messages/send', [ 'to' => '6281234567890', 'body' => 'Halo dari ERP!', ]);
Python
import requests API_KEY = "wsofa_your_api_key_here" BASE_URL = "https://waefo.my.id/api/v1" headers = { "Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json", } # Cek saldo resp = requests.get(f"{BASE_URL}/balance", headers=headers) data = resp.json() print(f"Saldo: {data['data']['wa_balance']}") # Kirim pesan resp = requests.post(f"{BASE_URL}/messages/send", headers=headers, json={ "to": "6281234567890", "body": "Halo dari ERP!", }) result = resp.json() if result["success"]: print(f"Pesan terkirim! ID: {result['data']['message_id']}")
Node.js / JavaScript
const API_KEY = 'wsofa_your_api_key_here'; const BASE_URL = 'https://waefo.my.id/api/v1'; async function apiRequest(method, endpoint, data = null) { const response = await fetch(`${BASE_URL}${endpoint}`, { method, headers: { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json', }, body: data ? JSON.stringify(data) : undefined, }); return await response.json(); } // Cek saldo const balance = await apiRequest('GET', '/balance'); console.log('Saldo:', balance.data.wa_balance); // Kirim pesan const result = await apiRequest('POST', '/messages/send', { to: '6281234567890', body: 'Halo dari ERP!', }); console.log('Hasil:', result);
WA EFO Blast Pro API v1.0