Least privilege
ผู้ดูแลเลือก scope, ห้อง, วันหมดอายุ, origin และ rate limit ให้แต่ละ client
เอกสารสำหรับนักพัฒนา ระบบภายนอก และ AI agents ใช้ OpenAPI 3.1, API key แบบ least privilege, จำกัดขอบเขตตามห้อง และไม่ต้องแจก Supabase service-role key
ผู้ดูแลเลือก scope, ห้อง, วันหมดอายุ, origin และ rate limit ให้แต่ละ client
OpenAPI 3.1 พร้อม operationId และ schema ใช้สร้าง client หรือให้ AI อ่านได้โดยตรง
Signed webhook แบบ HMAC ใช้ delivery ID เดิมเมื่อ retry เพื่อรองรับ idempotency
spk_live_… ตอนที่แสดงครั้งเดียว แล้วเก็บไว้ใน secret manager ของ backendAuthorization: Bearer จาก backend เท่านั้น ห้ามฝังใน browser, mobile bundle, URL หรือ Gitcurl --fail-with-body \
-H "Authorization: Bearer $SPK_API_KEY" \
"https://<your-domain>/api/v1/students?limit=50"ผลสำเร็จอยู่ใต้ data; รายการแบ่งหน้ามี meta.next_cursor ซึ่งต้องส่งกลับเป็น cursor โดยไม่แก้ไขค่าเอง
/api/v1/studentsstudents:readรายชื่อนักเรียนแบบ cursor pagination; กรองห้อง สถานะ และ updated_since
/api/v1/students/{id}students:readโปรไฟล์นักเรียนแบบลดฟิลด์และไม่เปิดเผยข้อมูลอ่อนไหว
/api/v1/students/{id}/statusstudents:readสถานะการศึกษาในปัจจุบัน
/api/v1/students/{id}/enrollmentsenrollments:readประวัติปีการศึกษา ห้อง และเลขที่
/api/v1/students/{id}/conductconduct:readรายการคะแนนพฤติกรรมแบบแบ่งหน้า
/api/v1/students/{id}/attendanceattendance:readการมาเรียนตามช่วงวันที่ สูงสุด 366 วัน
/api/v1/sectionssections:readรายการห้องเรียนแบบแบ่งหน้า
/api/v1/sections/{id}/studentssections:readรายชื่อนักเรียนที่กำลังเรียนในห้อง
/api/v1/extensions/exchangeone-time tokenแลก launch token อายุสั้นสำหรับระบบเสริม
students:readenrollments:readconduct:readattendance:readsections:read{
"error": {
"code": "insufficient_scope",
"message": "ต้องมี scope students:read",
"request_id": "…"
}
}ใช้ exponential backoff เฉพาะ network error, 429 และ 503 ไม่ retry 401/403 จนกว่าจะแก้คีย์หรือสิทธิ์ ใช้ request_id แจ้งผู้ดูแลโดยไม่ส่ง API key หรือข้อมูลนักเรียน
/api/v2; v1 จะไม่เปลี่ยนความหมายหรือลบ field โดยไม่ประกาศCache-Control: private, no-store