API Documentation

REST API Documentation

Complete API reference for Axum Desktop โ†” PHP Server integration

โœ… Server Active ๐Ÿ“ก 18 Endpoints ๐Ÿ”Œ JSON REST API ๐Ÿฆ€ Axum Compatible
Base URL
https://finger-alfa.apotikrestu.id//api.php?action={ACTION}

API Tester (Live)

๐Ÿ“Š Dashboard API 1 endpoint

GET
dashboard_stats

Mengambil statistik ringkasan: total karyawan, total log, absensi hari ini, check in/out, jumlah dealer, dan 10 log terakhir.

๐Ÿ‘ฅ Karyawan API 4 endpoints

GET
employees

Daftar karyawan dengan pagination, search, filter dealer, dan sorting.

Params: page, limit, search, dealer_code, sort_by, sort_order
POST
employees

Tambah/update karyawan. Upsert berdasarkan unique key dealer_code + employee_no.

Body: employee_no*, name*, nip, dealer_code, dealer_name
GET
employee_detail

Detail karyawan + ringkasan kehadiran (total logs, first & last attendance).

Params: employee_no*, dealer_code
POST
employee_delete

Hapus karyawan berdasarkan employee_no dan opsional dealer_code.

Body: employee_no*, dealer_code

โฑ Absensi API 3 endpoints

GET
attendance_logs

Log absensi dengan join nama karyawan. Mendukung filter tanggal, karyawan, dealer, status.

Params: page, limit, date, employee_no, dealer_code, status
POST
attendance

Simpan satu log absensi. Upsert berdasarkan unique key.

Body: employee_no*, timestamp*, status*, device_id
POST
attendance_delete

Hapus satu log absensi berdasarkan ID.

Body: id*

๐Ÿ“‹ Laporan API 2 endpoints

GET
laporan_absensi

Laporan harian per karyawan: check in, check out, durasi kerja. Grouped by employee + date.

Params: month* (YYYY-MM), dealer_code, employee_no
GET
laporan_summary_bulanan

Ringkasan bulanan per karyawan: total hari hadir, total scan, rentang kehadiran.

Params: month* (YYYY-MM), dealer_code

๐Ÿข Dealer API 2 endpoints

GET
dealers

Daftar semua dealer unik beserta jumlah karyawan dan log absensi.

GET
dealer_detail

Detail dealer: daftar karyawan, jumlah absensi, waktu sync terakhir.

Params: dealer_code*

๐Ÿ”„ Sync API (Axum โ†’ Server) โญ Primary

POST
sync_all Endpoint Utama

Endpoint utama dari Axum SyncService. Kirim semua karyawan + log absensi baru per dealer. Mendukung chunked sync (1000 records per request).

Body: kode_dealer*, nama_dealer*, employees[], attendance_logs[]
POST
get_last_sync_time

Ambil timestamp sinkronisasi terakhir untuk incremental sync.

Body: kode_dealer*

๐Ÿ“ฆ Bulk Operations 3 endpoints

POST
bulk_employees

Bulk insert/update banyak karyawan sekaligus.

Body: employees[]*, dealer_code, dealer_name
POST
bulk_attendance

Bulk insert/update banyak log absensi sekaligus.

Body: attendance_logs[]*, dealer_code, dealer_name
POST
purge_attendance โš ๏ธ Destructive

Hapus log absensi yang lebih lama dari tanggal tertentu. Operasi tidak dapat dibatalkan!

Body: before_date* (YYYY-MM-DD), dealer_code

๐Ÿฉบ Health & Server Info 2 endpoints

GET
health

Health check: status server, koneksi database, timezone, versi PHP.

GET
server_info

Info lengkap server: statistik data, first/last record, database info.