Base URL: {{baseUrl}} = http://notif.kuroichi.my.id/api ยท Auth: Authorization: Bearer <token> (token admin global atau token pegawai)
โฆ/test/* menulis/menghapus data. Jangan expose token admin ke publik.| Variable | Contoh | Keterangan |
|---|---|---|
baseUrl | http://notif.kuroichi.my.id/api | Server API (lokal: http://10.10.11.40:8080/api) |
api_token | notif-secret-key-2026 | Token admin global |
employee_token | โ | Token pegawai (dari Admin Panel / POST /employees) |
nup | 2211331144 | NUP pegawai (demo) |
access_token / refresh_token | โ | Dari POST /auth/login (Keycloak) |
Login username/password, bebas CORS WebView. Kembalikan tokens{access_token,refresh_token,expires_in} + user{nup,nama,โฆ}.
{
"username": "demo",
"password": "ganti-password"
}
Tukar refresh token โ access baru. Sesi permanen via scope offline_access.
{ "refresh_token": "{{refresh_token}}" }
Auth: Bearer {{access_token}} (token Keycloak, bukan admin)
Atribut per akun (nup/unitkerja/jabatan/โฆ) via Account API + fallback email-match DB.
Publik, tanpa auth. {"status":"ok"}
Nama, size, updated_at APK tanpa unduh.
Auth: Bearer {{api_token}}
{
"device_id": "test-device-001",
"device_name": "HP Test",
"platform": "android"
}
Auth: Bearer {{api_token}} ยท NUP kunci, token fallback
Hanya broadcast (is_broadcast) atau NUP dikunci untuk user. Device terima target_nups_count (bukan daftar). Retensi 6 bulan.
Detail + target_summary. 404 bila bukan target / lebih tua 6 bulan.
{
"device_id": "{{employee_token}}",
"employee_token": "{{employee_token}}",
"nup": "{{nup}}"
}
{
"title": "Pengumuman",
"body": "Untuk semua",
"priority": "high"
}
{
"title": "Khusus",
"body": "Hanya NUP terpilih",
"priority": "normal",
"link": "https://example.com/doc.pdf",
"target_nups": ["{{nup}}"]
}
{
"title": "Personal",
"body": "Hanya device ini",
"device_ids": ["{{employee_token}}"]
}
Sembunyi dari device, badge di admin. Pulihkan via POST {{baseUrl}}/notifications/:id/restore
Log full (tanpa retensi): targets_count, target_summary, daftar NUP max 200 + target_nups_total.
{
"nama": "Budi Santoso",
"nup": "12345",
"unit_kerja": "IT",
"jabatan": "Staff",
"status_pegawai": "Aktif"
}
PUT: { "id": 1, "jabatan": "Supervisor" }
DELETE: { "id": 1 }
Rotate token tak memutus kiriman (fetch kunci NUP).
{
"nup": "{{nup}}",
"tanggal": "2026-09-13",
"jam_masuk": "08:00",
"jam_pulang": "17:00"
}
{
"employee_token": "{{employee_token}}",
"device_uuid": "uuid-hp-001"
}
{"valid":true} atau {"valid":false,"reason":"device_changed"}.
| Field | Default |
|---|---|
| nup | 2211331144 |
| tanggal / jam_masuk / jam_pulang | hari ini / 08:15 / 17:05 |
{}
{"title":"Uji Coba","body":"Pesan dummy","priority":"high"}
Default 4 tabel (attendances, notifications, device_notifications, notification_nups). employees/devices aman โ kecuali kirim {"tables":["all"]} (semua 6 tabel, token pegawai hangus, HP wajib login ulang).
{}
# Reset SEMUA tabel (bahaya):
{"tables":["all"]}
1. POST /test/attendance {}
2. GET /attendance/today?nup=2211331144
3. POST /test/notification {}
4. GET /notifications?nup=2211331144&employee_token=...
5. POST /test/reset {}