Dokumentasi API SekolahKu
API RESTful untuk integrasi dan pengelolaan sistem sekolah. Standar OAuth2, response JSON.
Base URL: https://sekolahku.sains.dev/api/v1
Overview
API SekolahKu menggunakan OAuth2 untuk autentikasi. Semua request ke endpoint yang terproteksi harus menyertakan access token di header Authorization.
OAuth2 Grant Types
API ini mendukung 3 grant type OAuth2:
- Client Credentials โ untuk server-to-server integration (paling umum)
- Password โ untuk login via username/password (deprecated untuk third-party)
- Authorization Code โ untuk OAuth2 web flow
- Refresh Token โ untuk perpanjangan access token
Quick Start
bash โ 3 Langkah
# 1. Daftar sekolah di panel SekolahKu
# 2. Dapatkan client_id & client_secret
# 3. Tukar dengan access token
curl -X POST https://sekolahku.sains.dev/api/v1/oauth/token \
-H "Content-Type: application/json" \
-d '{
"grant_type": "client_credentials",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET"
}'
๐งช Try It โ Client Credentials Grant
Token Endpoint
Refresh Token
POST
โถ
/oauth/token/refresh
Perpanjang Access Token
Gunakan refresh token untuk mendapatkan access token baru tanpa login ulang.
| Field | Type | Required | Description |
|---|---|---|---|
| refresh_token | string | required | Refresh token dari response token sebelumnya |
๐งช Try It
Revoke Token
POST
โถ
/oauth/revoke
Cabut Access Token
Cabut access token atau refresh token sebelum expired.
| Field | Type | Required | Description |
|---|---|---|---|
| token | string | required | Token yang akan dicabut |
Get Current Token Info
GET
โถ
/me
Info User & Token
Dapatkan informasi user dan scope yang terkait dengan access token saat ini.
Authorization: Bearer {token}
curl -X GET https://sekolahku.sains.dev/api/v1/me \
-H "Authorization: Bearer {access_token}"