Notifikasi (Notifications)
Dokumentasi API untuk manajemen pesan sistem, pemberitahuan transaksi, dan promo khusus pengguna.
Endpoint Overview
| Method | Endpoint | Deskripsi |
|---|---|---|
| GET | /notifications | Mengambil daftar notifikasi dengan pagination & filter. |
| GET | /notifications/:id | Mengambil detail lengkap satu notifikasi. |
| PUT | /notifications/:id/read | Menandai satu notifikasi sebagai sudah dibaca. |
| PUT | /notifications/read-all | Menandai semua notifikasi sebagai sudah dibaca. |
| GET | /notifications/unread-count | Mengambil jumlah notifikasi yang belum dibaca. |
1. Get Notification List
Mengambil daftar pemberitahuan untuk pengguna yang sedang login.
- URL:
/notifications - Method:
GET - Headers:
Authorization: Bearer {{token}} - Query Parameters:
page,max: Pagination (default: 1, 10).type: Filter tipe (transaction,promotion,system).is_read: Filter status baca (true/false).
- Response (200 OK):
{
"total_rows": 25,
"rows": [
{
"id": "uuid-01",
"type": "transaction",
"subtype": "payment_success",
"title": "Pembayaran Berhasil",
"body": "Pembayaran untuk Tour Bali telah berhasil diproses",
"is_read": false,
"created_at": "2026-03-20T10:00:00Z"
}
]
}
2. Mark as Read
Menandai notifikasi tertentu atau seluruh notifikasi sebagai sudah dibaca untuk menghilangkan indikator (badge) di aplikasi.
- URL:
/notifications/:id/read(Single) atau/notifications/read-all(Global) - Method:
PUT - Response (200 OK):
{
"message": "Notification marked as read"
}
🔥 Uji Coba API (Simulator)
Gunakan simulator di bawah ini untuk mencoba seluruh endpoint di atas secara langsung. Anda dapat mengubah URL, Method, Headers, dan Body sesuai kebutuhan.