跳至正文

API文档

Smrt English客户API

这是一个只读API,将学生和班级记录返回至您所在机构的系统。每个API密钥(API key)只能访问其所属机构的数据。

打开测试中心

运作方式

请求的处理流程

您的系统使用自己的API密钥请求某位学生或某个班级的数据,API以只读方式返回相应记录。

您的系统您的学生信息管理系统或报表工具。
您的API密钥随每个请求一同发送,并与您的学校绑定。
Smrt English API面向学生和班级数据的只读接口。
您的记录以JSON格式返回的成绩、考勤和班级学生名单。
keyboard_arrow_up

Smrt English API

school Get Single Class Endpoint

Endpoint Details

Endpoint: GET /smrtapi/v1/class/{class_id}

Purpose: Retrieve comprehensive class data including student roster, teacher information, course details, and class-level statistics.

URL Parameters

Parameter Type Description
class_id integer Unique class identifier (required)

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/class/456

Response Example (abbreviated):

{
  "success": true,
  "data": {
    "class": {
      "class_id": 456,
      "class_title": "English 101 - Section A",
      "class_code": "ENG101-A",
      "class_status": 1,
      "class_room": "Room 204",
      "class_dateadded": "2024-01-10",
      "course": {
        "course_id": 12,
        "course_name": "General English",
        "course_subtitle": "Beginner Level"
      },
      "teacher": {
        "teacher_id": 78,
        "name": "Jane Smith",
        "email": "[email protected]"
      }
    },
    "summary": {
      "student_count": 25,
      "average_completion_rate": 82.5,
      "average_assignment_score": 78.3,
      "total_engagement_minutes": 1250.5
    },
    "students": [
      {
        "id": 12345,
        "email": "[email protected]",
        "name": "John Student",
        "enrollment_date": "2024-01-15",
        "progress": {
          "assignments": {
            "total_count": 15,
            "completed_count": 12,
            "completion_rate": 80.0,
            "average_score": 85.5
          }
        }
      }
    ]
  }
}

Use Cases

  • Class Roster Management - Get complete list of students enrolled in a class
  • Teacher Dashboards - Display class performance metrics and student progress
  • Class Performance Analysis - Analyze how students are performing in a specific class
  • Attendance Integration - Cross-reference with attendance systems using enrollment data
  • Progress Reports - Generate detailed class progress reports for administrators

Response Format

Returns comprehensive class information with student roster and statistics:

Response Fields - Class Object

Field Type Description
class_id integer Unique class identifier
class_title string Class name/title
class_code string Class code/section identifier
class_status integer Status (0=inactive, 1=active)
course.course_id integer Course identifier
teacher.name string Primary teacher name
teacher.email string Primary teacher email

Response Fields - Summary Object

Field Type Description
student_count integer Number of enrolled students
average_completion_rate float Average assignment completion rate (0-100)
average_assignment_score float Average assignment score (0-100, null if none)
total_engagement_minutes float Total learning time for all students

Response Fields - Students Array

Each student object in the students array includes:

Field Type Description
id integer Student user ID
name string Student full name
email string Student email address
enrollment_date string Date enrolled in class (YYYY-MM-DD)
progress.* object Student's progress statistics in this class

Note: Only registered students are included. The student progress statistics are class-specific.