🚀 Japregeo API

Dokumentasi API yang Mudah Dipahami

📋 Informasi API

Base URL: http://localhost:8080

Version: 1.0.0

Format: JSON

🔐 Authentication

POST /v1/auth/login
Login untuk mendapatkan access token dan refresh token
Request Body:
company_username (string) - Username perusahaan, contoh: "INSOM"
username (string) - Username karyawan, contoh: "fahmi1"
password (string) - Password karyawan
device_type (string) - Tipe device, contoh: "Android"
ip_address (string) - IP address device
timezone (string) - Timezone, contoh: "Asia/Jakarta"
product (string) - Nama produk, contoh: "Japregeo"
fcm (string) - Firebase Cloud Messaging token
Response:
200 OK
{ "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "access_exp": 1640995200, "refresh_token": "refresh_token_abc123", "refresh_exp": 1643587200, "employee": { "id": 1, "username": "fahmi1", "name": "Fahmi", "email": "[email protected]" }, "login_history_id": 1 }
POST /v1/auth/refresh
Refresh access token menggunakan refresh token
Request Body:
refresh_token (string) - Refresh token yang valid
Response:
200 OK
{ "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "access_exp": 1640995200, "refresh_token": "refresh_token_def456", "refresh_exp": 1643587200 }
POST /v1/auth/logout
Logout dan blacklist access token
Headers:
Authorization (string) - Bearer {access_token}
Response:
200 OK
"Logged out successfully"

👤 User Information

GET /v1/me
Mendapatkan informasi user yang sedang login
Headers:
Authorization (string) - Bearer {access_token}
Response:
200 OK
{ "id": 1, "company_id": 1, "username": "fahmi1", "name": "Fahmi", "email": "[email protected]", "phone": "+6281234567890", "status": "active", "created_at": "2024-01-01T00:00:00Z", "updated_at": "2024-01-01T00:00:00Z" }

🔧 System

GET /healthz
Health check untuk memastikan API berjalan dengan baik
Response:
200 OK
"OK"
💡 Tips: