Files
webgis/poverty-mapping/docs/openapi.yaml
T
2026-06-11 17:43:01 +07:00

209 lines
4.8 KiB
YAML

openapi: 3.0.3
info:
title: WebGIS API
version: 1.0.0
description: API untuk autentikasi pengelola, data lokasi, unggah foto, dan persetujuan admin.
servers:
- url: .
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
basicAuth:
type: http
scheme: basic
schemas:
RegisterRequest:
type: object
required:
- email
- password
- name
- organization
- org_address
- org_phone
- verify_code
properties:
email:
type: string
format: email
password:
type: string
name:
type: string
organization:
type: string
org_address:
type: string
org_phone:
type: string
verify_code:
type: string
pattern: '^[0-9]{6}$'
LoginRequest:
type: object
required:
- email
- password
properties:
email:
type: string
format: email
password:
type: string
LocationRequest:
type: object
properties:
nama:
type: string
jenis:
type: string
no_telp:
type: string
alamat:
type: string
latitude:
type: number
longitude:
type: number
assisted:
type: integer
enum: [0, 1]
paths:
/src/api/auth/register.php:
post:
summary: Daftar pengelola baru
requestBody:
required: true
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/RegisterRequest'
application/json:
schema:
$ref: '#/components/schemas/RegisterRequest'
responses:
'200':
description: Pendaftaran berhasil dan akun menunggu persetujuan admin
/src/api/auth/send_verification_code.php:
post:
summary: Kirim kode verifikasi email
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [email]
properties:
email:
type: string
format: email
responses:
'200':
description: Kode verifikasi terkirim
/src/api/auth/login.php:
post:
summary: Login pengguna
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/LoginRequest'
responses:
'200':
description: Login berhasil
/src/api/auth/logout.php:
post:
summary: Logout pengguna
security:
- bearerAuth: []
responses:
'200':
description: Logout berhasil
/src/api/auth/me.php:
get:
summary: Ambil sesi pengguna aktif
security:
- bearerAuth: []
responses:
'200':
description: Status autentikasi saat ini
/src/api/get_client_config.php:
get:
summary: Konfigurasi klien yang aman untuk frontend
responses:
'200':
description: Data konfigurasi klien
/src/api/get_lokasi.php:
get:
summary: Ambil daftar lokasi
responses:
'200':
description: Daftar lokasi
/src/api/tambah_lokasi.php:
post:
summary: Tambah lokasi baru
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/LocationRequest'
responses:
'200':
description: Data berhasil dibuat
/src/api/update_lokasi.php:
post:
summary: Perbarui lokasi
security:
- bearerAuth: []
responses:
'200':
description: Data berhasil diperbarui
/src/api/hapus_lokasi.php:
post:
summary: Hapus lokasi
security:
- bearerAuth: []
responses:
'200':
description: Data berhasil dihapus
/src/api/upload_photo.php:
post:
summary: Unggah foto lokasi
security:
- bearerAuth: []
responses:
'200':
description: Foto berhasil diunggah
/src/api/admin/list_pending_managers.php:
get:
summary: Daftar pengelola menunggu persetujuan
security:
- bearerAuth: []
responses:
'200':
description: Daftar akun pending
/src/api/admin/approve_user.php:
post:
summary: Setujui akun pengelola
security:
- bearerAuth: []
responses:
'200':
description: Akun disetujui
/src/api/admin/reject_user.php:
post:
summary: Tolak akun pengelola
security:
- bearerAuth: []
responses:
'200':
description: Akun ditolak