engine-whatsapp menyajikan 14 endpoint di /api (semua public, tanpa auth) plus GET /files/:filename (static).
Base URL
HTTP routes dipasang di /api. Local default: http://localhost:5002/api.
Autentikasi
| Kategori | Auth | Catatan |
|---|---|---|
/api/* | ❌ Tidak ada auth | Semua endpoint public — keamanan wajib di perimeter |
/files/:filename | ❌ public | Static file serving |
Response envelope
Semua endpoint lewat helper sendSuccess / sendError:
// Sukses
{ "success": true, "message": "...", "data": { } }
// Gagal
{ "success": false, "message": "...", "error": { } } // `error` disembunyikan saat APP_ENV=productionGrup endpoint
| Grup | Halaman | Endpoint |
|---|---|---|
| Session | Session API | POST /api/new, GET /api/qrcode, GET /api/logout, GET /api/device-info |
| Messaging | Messaging API | POST /api/send-message, POST /api/send-media, POST /api/send-location, POST /api/send-broadcast |
| Group | Group API | POST /api/group/create, GET /api/group/info, POST /api/group/participants |
| Notification | Notification API | POST /api/push-notif, POST /api/update-chatlist, POST /api/update-teamchat, POST /api/submit-pixel |
| Webhook | Webhook Reference | POST {WEBHOOK_URL}/callback_message (keluar ke backend) |
Daftar endpoint lengkap
| Endpoint | Method | Auth | Grup |
|---|---|---|---|
/api/new | POST | ❌ | Session |
/api/qrcode | GET | ❌ | Session |
/api/logout | GET | ❌ | Session |
/api/device-info | GET | ❌ | Session |
/api/send-message | POST | ❌ | Messaging |
/api/send-media | POST | ❌ | Messaging |
/api/send-location | POST | ❌ | Messaging |
/api/send-broadcast | POST | ❌ | Messaging |
/api/group/create | POST | ❌ | Group |
/api/group/info | GET | ❌ | Group |
/api/group/participants | POST | ❌ | Group |
/api/push-notif | POST | ❌ | Notification |
/api/update-chatlist | POST | ❌ | Notification |
/api/update-teamchat | POST | ❌ | Notification |
/api/submit-pixel | POST | ❌ | Notification |
/files/:filename | GET | ❌ | Static |
Catatan
/api/logoutmemakaiGET, bukanDELETE— komentar diSessionController.tsmenyebutDELETE, itu keliru- Tidak ada versioning (
/v1/) — semua route langsung di/api POST /api/send-messagemewajibkanpesan_id,role,data— ketiganya diteruskan ke payload Socket.IOsendContactsudah diimplementasi diMessageControllertapi tidak didaftarkan di router — tidak dapat diakses- Socket.IO server di port yang sama (
5002), CORS*— lihat Realtime Events
Webhook keluar
Engine mengirim POST {WEBHOOK_URL}/callback_message ke backend Dazo untuk:
| Kejadian | Field report | Payload |
|---|---|---|
| Pesan masuk | false | Pesan baru dari WhatsApp |
| Update status pesan | true | Status ACK (pending/sent/delivered/viewed/played) |
Detail payload di Webhook Reference.
Langkah berikutnya
- Detail session endpoint? Baca Session API.
- Detail messaging? Baca Messaging API.
- Detail webhook payload? Baca Webhook Reference.
- Cara validasi sesi? Baca Session Lifecycle.