เอกสาร API
Smrt English Client API
API แบบอ่านอย่างเดียว (read-only) ที่ส่งข้อมูลผู้เรียนและชั้นเรียนไปยังระบบของสถาบัน คีย์ API (API key) แต่ละคีย์เข้าถึงได้เฉพาะข้อมูลของสถาบันตนเอง
วิธีการทำงาน
ขั้นตอนการทำงานของคำขอ
ระบบของสถาบันขอข้อมูลผู้เรียนหรือชั้นเรียนด้วยคีย์ API ของตนเอง และ API จะส่งข้อมูลกลับแบบอ่านอย่างเดียว
dnsระบบของสถาบันระบบข้อมูลผู้เรียนหรือเครื่องมือจัดทำรายงานของสถาบัน
arrow_forwardkeyคีย์ API ของสถาบันส่งไปพร้อมทุกคำขอ และผูกกับสถานศึกษาของตน
arrow_forwardapiSmrt English APIendpoint แบบอ่านอย่างเดียวสำหรับผู้เรียนและชั้นเรียน
arrow_forwardtable_viewข้อมูลของสถาบันผลการเรียน การเข้าเรียน และรายชื่อผู้เรียนในชั้นเรียน ในรูปแบบ JSON
Smrt English API
Authentication Test Endpoint
Endpoint Details
Endpoint: GET /smrtapi/v1/auth
Purpose: Verify that your API key is valid and active
Headers Required
X-API-Key: your_institution_api_key
Example Request
curl -H "X-API-Key: your_institution_api_key" \ https://smrtenglish.com/smrtapi/v1/auth
Use Cases
- Verify API key before implementing full integration
- Test connectivity to the API
- Confirm school information and permissions
- Health check for API availability
Response Format
Success Response (200 OK):
{
"success": true,
"data": {
"authenticated": true,
"school": {
"id": 1,
"name": "Your Institution Name",
"key": "your_institution"
},
"api_key_name": "Your Institution Production API Key",
"timestamp": "2025-09-29 22:20:32"
},
"message": "API key is valid and active"
}
Error Response (401 Unauthorized):
{
"error": true,
"message": "Authentication required",
"status_code": 401,
"error_code": "AUTH_REQUIRED"
}
Response Fields
| Field | Type | Description |
|---|---|---|
authenticated |
boolean | Always true for successful auth |
school.id |
integer | Your institution's unique ID |
school.name |
string | Your institution's name |
school.key |
string | Your institution's unique key |
api_key_name |
string | Friendly name for the API key |
timestamp |
string | Server timestamp |