Skip to main content

Proxy Services

Dokumentasi API endpoints yang di-proxy ke microservices lain.

Overview

API Gateway bertindak sebagai entry point untuk semua microservices. Request ke services lain akan di-proxy oleh API Gateway.

Available Services

ServiceBase PathEnvironment Variable
Master Data/api/v1/master-data/SERVER_SERVICE_MASTER_DATA
Kepegawaian/api/v1/kepegawaian/SERVER_SERVICE_KEPEGAWAIAN
Keuangan/api/v1/keuangan/SERVER_SERVICE_KEUANGAN
Perizinan/api/v1/perizinan/SERVER_SERVICE_PERIZINAN
Pelaporan/api/v1/pelaporan/SERVER_SERVICE_PELAPORAN
Tramtibum/api/v1/tramtibum/SERVER_SERVICE_TRAMTIBUM
File/api/v1/file/SERVER_SERVICE_FILE
Notification/api/v1/notification/SERVER_SERVICE_NOTIFICATION

Master Data Service

Base URL

/api/v1/master-data

Common Endpoints

MethodPathDescription
GET/provinsiDaftar provinsi
GET/kabupaten-kotaDaftar kabupaten/kota
GET/kecamatanDaftar kecamatan
GET/kelurahanDaftar kelurahan
GET/satuan-kerjaDaftar satuan kerja
GET/jabatanDaftar jabatan

Example:

curl -X GET "http://localhost:8000/api/v1/master-data/provinsi" \
-H "Authorization: xxxTOKENxxxxx"

Kepegawaian Service

Base URL

/api/v1/kepegawaian

Common Endpoints

MethodPathDescription
GET/pegawaiDaftar pegawai
GET/pegawai/:idDetail pegawai
POST/pegawaiTambah pegawai
PUT/pegawai/:idUpdate pegawai
DELETE/pegawai/:idHapus pegawai
GET/riwayat-jabatanRiwayat jabatan
GET/riwayat-pendidikanRiwayat pendidikan

Example:

curl -X GET "http://localhost:8000/api/v1/kepegawaian/pegawai" \
-H "Authorization: xxxTOKENxxxxx"

Keuangan Service

Base URL

/api/v1/keuangan

Common Endpoints

MethodPathDescription
GET/gajiData gaji
GET/tunjanganData tunjangan
GET/potonganData potongan
GET/slip-gajiSlip gaji

Example:

curl -X GET "http://localhost:8000/api/v1/keuangan/slip-gaji?bulan=1&tahun=2024" \
-H "Authorization: xxxTOKENxxxxx"

Perizinan Service

Base URL

/api/v1/perizinan

Common Endpoints

MethodPathDescription
GET/cutiDaftar cuti
POST/cutiAjukan cuti
PUT/cuti/:idUpdate cuti
GET/izinDaftar izin
POST/izinAjukan izin

Example:

curl -X POST "http://localhost:8000/api/v1/perizinan/cuti" \
-H "Content-Type: application/json" \
-H "Authorization: xxxTOKENxxxxx" \
-d '{
"tanggal_mulai": "2024-02-01",
"tanggal_selesai": "2024-02-05",
"jenis_cuti": "tahunan",
"keterangan": "Liburan keluarga"
}'

Pelaporan Service

Base URL

/api/v1/pelaporan

Common Endpoints

MethodPathDescription
GET/laporanDaftar laporan
POST/laporanBuat laporan
GET/laporan/:idDetail laporan
GET/statistikStatistik pelaporan

Example:

curl -X GET "http://localhost:8000/api/v1/pelaporan/statistik?tahun=2024" \
-H "Authorization: xxxTOKENxxxxx"

Tramtibum Service

Base URL

/api/v1/tramtibum

Common Endpoints

MethodPathDescription
GET/kegiatanDaftar kegiatan
POST/kegiatanBuat kegiatan
GET/kegiatan/:idDetail kegiatan
GET/penindakanDaftar penindakan

Example:

curl -X GET "http://localhost:8000/api/v1/tramtibum/kegiatan" \
-H "Authorization: xxxTOKENxxxxx"

File Service

Base URL

/api/v1/file

Common Endpoints

MethodPathDescription
POST/uploadUpload file
GET/:idDownload file
DELETE/:idDelete file

Example Upload:

curl -X POST "http://localhost:8000/api/v1/file/upload" \
-H "Authorization: xxxTOKENxxxxx" \
-F "file=@/path/to/file.pdf" \
-F "folder=documents"

Example Download:

curl -X GET "http://localhost:8000/api/v1/file/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: xxxTOKENxxxxx" \
--output downloaded_file.pdf

Notification Service

Base URL

/api/v1/notification

Common Endpoints

MethodPathDescription
GET/Daftar notifikasi
GET/:idDetail notifikasi
PUT/:id/readMark as read
DELETE/:idDelete notifikasi
GET/unread-countJumlah belum dibaca

Example:

curl -X GET "http://localhost:8000/api/v1/notification?status=unread" \
-H "Authorization: xxxTOKENxxxxx"

Proxy Behavior

Request Forwarding

Semua request akan di-forward dengan:

  • Original headers (except Host)
  • Original query parameters
  • Original request body
  • Added Authorization header

Response Handling

Response dari upstream service akan dikembalikan as-is, termasuk:

  • Status code
  • Response headers
  • Response body

Error Handling

ScenarioStatus CodeMessage
Service not configured503Service unavailable
Service unreachable502Bad gateway
Timeout504Gateway timeout

Swagger Documentation

Dokumentasi Swagger dari semua services digabung dan tersedia di:

GET /api/v1/docs.json

Swagger UI:

GET /api/v1/swagger/index.html