跳至主要內容

API文件

Smrt English客戶API

這是一個唯讀API,將學生與班級紀錄回傳至您機構的系統。每個API金鑰(API key)只能存取其所屬機構的資料。

開啟測試中心

運作方式

請求的處理流程

您的系統以自己的API金鑰請求某位學生或某個班級的資料,API以唯讀方式回傳相應紀錄。

您的系統您的學生資訊管理系統或報表工具。
您的API金鑰隨每個請求一同傳送,並與您的學校綁定。
Smrt English API提供學生與班級資料的唯讀端點。
您的紀錄以JSON格式回傳的成績、出缺勤與班級學生名單。
keyboard_arrow_up

Smrt English API

verified_user 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