๐Ÿ”Œ API Documentation 29 views

API Documentation Overview

API Documentation Overview

Base URL: https://yourdomain.com/api/v1

Authentication: Laravel Sanctum (Bearer token)

Endpoints

Auth

  • POST /auth/login โ€” get token (body: email, password, device_name)
  • POST /auth/register โ€” register patient
  • GET /auth/me โ€” get current user (auth required)
  • POST /auth/logout โ€” revoke token (auth required)

Treatments (Public Read)

  • GET /treatments โ€” list (param: category)
  • GET /treatments/{id} โ€” detail

Patients (Auth Required)

  • GET /patients โ€” list (admin: all in clinic, patient: own only)
  • POST /patients โ€” create (staff only)
  • GET /patients/{id} โ€” detail
  • PUT /patients/{id} โ€” update
  • DELETE /patients/{id} โ€” delete (staff only)

Appointments (Auth Required)

  • GET /appointments โ€” list (param: date, status)
  • POST /appointments โ€” create
  • GET /appointments/{id} โ€” detail
  • PUT /appointments/{id} โ€” update
  • POST /appointments/{id}/cancel โ€” cancel (body: reason)
  • DELETE /appointments/{id} โ€” delete

Example Login Flow

# Login
curl -X POST https://yourdomain.com/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "admin@klinik.com",
    "password": "password",
    "device_name": "mobile-app"
  }'

# Response:
# {
#   "token": "1|XXXXXXXXXXX",
#   "user": {"id":1,"name":"Admin","email":"...","role":"owner"}
# }

# Use token
curl https://yourdomain.com/api/v1/patients \
  -H "Authorization: Bearer 1|XXXXXXXXXXX" \
  -H "Accept: application/json"

Rate Limiting

  • Default: 60 requests/minute per token
  • Login endpoint: 5 attempts/minute per IP

Error Format

{
  "message": "The given data was invalid.",
  "errors": {
    "field_name": ["validation message"]
  }
}

RBAC di API

  • Patient role โ†’ hanya bisa GET data sendiri (auto-filter by user_id)
  • Staff role โ†’ CRUD sesuai permission Spatie
  • Unauthenticated โ†’ 401, kecuali endpoint public (/treatments)
Build in Public

Development Progress & Roadmap

Lihat live progress: berapa fitur sudah live, fase mana yang lagi dikerjakan, dan estimasi timeline.

Lihat Progress
Showcase Lihat semua kemampuan aplikasi

Semua fitur admin dalam satu halaman

Screenshot real dari panel admin + penjelasan kegunaan tiap modul (CRM pasien, odontogram, billing, AI assistant, dll.) โ€” auto-update setiap ada fitur baru.

Buka Showcase
Cari yang lain? Kembali ke beranda ยท Login portal