본문 바로가기

API 문서

Smrt English Client API

학생과 클래스 기록을 기관의 시스템으로 제공하는 읽기 전용 API입니다. 각 API 키(API key)는 해당 기관의 데이터에만 접근할 수 있습니다.

테스트 허브 열기

작동 방식

요청 처리 방식

기관의 시스템이 자체 API 키로 학생이나 클래스 정보를 요청하면, API가 해당 기록을 읽기 전용으로 반환합니다.

기관 시스템기관의 학생 정보 시스템이나 리포트 도구입니다.
기관의 API 키모든 요청과 함께 전송되며, 해당 학교에 연결되어 있습니다.
Smrt English API학생과 클래스 정보를 위한 읽기 전용 엔드포인트입니다.
기관의 기록성적, 출결, 클래스 명단을 JSON으로 제공합니다.
keyboard_arrow_up

Smrt English API

class Get Classes List Endpoint

Endpoint Details

Endpoint: GET /smrtapi/v1/classes

Purpose: Retrieve a paginated list of classes with summary statistics. Perfect for class roster management, teacher assignment tracking, and institutional reporting.

Query Parameters

Parameter Type Default Description
page integer 1 Page number (must be ≥ 1)
limit integer 50 Results per page (1-100)
status integer - Filter by status (0=inactive, 1=active)
course_id integer - Filter by specific course
teacher_id integer - Filter by teacher ID
teacher_email string - Filter by teacher email address
search string - Search by class title or class code

Headers Required

X-API-Key: your_institution_api_key

Example Requests

# Get first page (default 50 classes)
curl -H "X-API-Key: your_institution_api_key" \
  https://smrtenglish.com/smrtapi/v1/classes

# Get specific page with custom limit
curl -H "X-API-Key: your_institution_api_key" \
  "https://smrtenglish.com/smrtapi/v1/classes?page=2&limit=25"

# Filter by active classes only
curl -H "X-API-Key: your_institution_api_key" \
  "https://smrtenglish.com/smrtapi/v1/classes?status=1"

# Filter by teacher email
curl -H "X-API-Key: your_institution_api_key" \
  "https://smrtenglish.com/smrtapi/v1/[email protected]"

# Filter by course
curl -H "X-API-Key: your_institution_api_key" \
  "https://smrtenglish.com/smrtapi/v1/classes?course_id=12"

Response Example (abbreviated):

{
  "success": true,
  "data": [
    {
      "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"
      },
      "teacher": {
        "teacher_id": 78,
        "name": "Jane Smith",
        "email": "[email protected]"
      },
      "student_count": 25,
      "summary": {
        "average_completion_rate": 82.5,
        "average_score": 78.3,
        "total_engagement_minutes": 1250.5
      },
      "assignment_activity": {
        "has_assignments": true,
        "assignment_count": 15,
        "first_assignment_date": "2024-01-15",
        "last_assignment_date": "2024-10-05",
        "students_enrolled": 25,
        "students_with_submissions": 22,
        "students_without_submissions": 3
      }
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 50,
    "total_count": 15,
    "total_pages": 1,
    "has_next": false,
    "has_prev": false
  }
}

Use Cases

  • Class Roster Export - Pull complete class lists for institutional reporting
  • Teacher Workload Analysis - Track how many classes each teacher manages
  • Course Enrollment Reports - See how many sections exist for each course
  • Performance Comparison - Compare performance metrics across different classes
  • Active Class Monitoring - Track which classes are currently active vs archived
  • Integration with Scheduling - Sync class data with scheduling systems

Response Format

Returns a paginated list of classes with summary 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)
student_count integer Number of enrolled students
course.course_id integer Associated course ID
teacher.name string Primary teacher name
summary.average_completion_rate float Average completion rate (0-100)
summary.average_score float Average assignment score (0-100)

Pagination Object:

  • page - Current page number
  • limit - Results per page
  • total_count - Total classes matching filter
  • total_pages - Total pages available
  • has_next - Boolean, true if more pages exist
  • has_prev - Boolean, true if previous page exists

Filtering Best Practices

  • Use status=1 to get only active classes for current reporting
  • Use teacher_email to get all classes for a specific teacher
  • Use course_id to see all sections of a particular course
  • Combine filters for precise queries (e.g., active classes for a specific teacher)

Example: Get All Classes for a Teacher

import requests

api_key = "your_institution_api_key"
teacher_email = "[email protected]"
base_url = "https://smrtenglish.com/smrtapi/v1/classes"
headers = {"X-API-Key": api_key}

response = requests.get(
    base_url,
    headers=headers,
    params={"teacher_email": teacher_email, "status": 1}
)

data = response.json()
classes = data["data"]

print(f"Teacher {teacher_email} has {len(classes)} active classes")
for cls in classes:
    print(f"  - {cls['class_title']} ({cls['student_count']} students)")

Note: For detailed class data including full student roster with individual progress, use the Get Single Class endpoint.