GET /classes/{classId}

Retrieves a specific class by its ID (must be owner or enrolled).

Path parameters

  • classId string Required

    The class ID

Responses

  • 200 application/json

    Class retrieved successfully

    Hide response attributes Show response attributes object
    • success boolean
    • code integer(int32)
    • message string
    • data object

      Class (learning group) representing a classroom with enrolled students

      Hide data attributes Show data attributes object
      • id string Required

        Unique identifier for the class

      • ownerId string Required

        ID of the teacher/owner who created the class

      • name string Required

        Name of the class (e.g., "10A1", "11B2")

        Maximum length is 50.

      • description string | null

        Description or notes about the class

      • joinCode string | null

        Unique join code for students to enroll

        Maximum length is 10.

      • settings object | null

        Class-specific settings like theme, allow_comments, etc.

      • isActive boolean

        Whether the class is active

      • createdAt string(date-time)

        Timestamp when the class was created

      • updatedAt string(date-time)

        Timestamp when the class was last updated

  • 401 application/json

    Unauthorized - Invalid or missing authentication token

    Hide response attributes Show response attributes object
    • success boolean
    • code integer
    • errorCode string
    • message string
    • timestamp string(date-time)
  • 403 application/json

    Forbidden - Insufficient permissions

    Hide response attributes Show response attributes object
    • success boolean
    • code integer
    • errorCode string
    • message string
    • timestamp string(date-time)
  • 404 application/json

    Not Found - Resource does not exist

    Hide response attributes Show response attributes object
    • success boolean
    • code integer
    • errorCode string
    • message string
    • timestamp string(date-time)
  • 500 application/json

    Internal Server Error

    Hide response attributes Show response attributes object
    • success boolean
    • code integer
    • errorCode string
    • message string
    • timestamp string(date-time)
GET /classes/{classId}
curl \
 --request GET 'https://api.huy-devops.site/api/classes/{classId}' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "success": true,
  "code": 200,
  "message": "string",
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "ownerId": "550e8400-e29b-41d4-a716-446655440001",
    "name": "12A",
    "description": "Advanced Science Track",
    "joinCode": "ABCD1234",
    "settings": {
      "theme": "light",
      "allow_comments": true
    },
    "isActive": true,
    "createdAt": "2024-01-15T10:30:00Z",
    "updatedAt": "2024-09-20T14:45:00Z"
  }
}
Response examples (401)
{
  "success": false,
  "code": 42,
  "errorCode": "string",
  "message": "string",
  "timestamp": "2026-05-04T09:42:00Z"
}
Response examples (403)
{
  "success": false,
  "code": 42,
  "errorCode": "string",
  "message": "string",
  "timestamp": "2026-05-04T09:42:00Z"
}
Response examples (404)
{
  "success": false,
  "code": 42,
  "errorCode": "string",
  "message": "string",
  "timestamp": "2026-05-04T09:42:00Z"
}
Response examples (500)
{
  "success": false,
  "code": 42,
  "errorCode": "string",
  "message": "string",
  "timestamp": "2026-05-04T09:42:00Z"
}