GET /classes/{classId}/dashboard

Retrieves unified dashboard view combining posts and assignments, sorted chronologically with pagination

Path parameters

  • classId string Required

    ID of the class

Query parameters

  • type string

    Filter by item type

    Values are post, assignment, or all. Default value is all.

  • startDate string(date-time)

    Filter items created after this date

  • endDate string(date-time)

    Filter items created before this date

  • page integer

    Page number (1-based)

    Minimum value is 1. Default value is 1.

  • pageSize integer

    Items per page

    Minimum value is 1, maximum value is 100. Default value is 10.

Responses

  • 200 application/json

    Dashboard items retrieved successfully

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

      Dashboard item representing either a post or assignment in unified view

      Hide data attributes Show data attributes object
      • itemType string

        Type of dashboard item

        Values are post or assignment.

      • id string

        ID of post or lesson (assignment)

      • classId string

        ID of the class

      • title string | null

        Post content preview or lesson title

      • content string | null

        Full post content or lesson content

      • author object

        Author information

        Hide author attributes Show author attributes object
        • id string
        • firstName string
        • lastName string
        • avatarUrl string | null
      • type string

        For posts - announcement/schedule_event/general; For assignments - lesson type

      • dueDate string(date-time) | null

        Due date for assignments only

      • maxPoints number | null

        Max points for assignments only

      • attachments array[object] | null

        Post attachments or lesson resources

        Represents resource linked to a post (either lesson resource or individual resource)

        Hide attachments attributes Show attachments attributes object
        • id string

          Resource ID

        • type string

          Type of resource

          Values are presentation, mindmap, document, video, audio, image, worksheet, equipment, or other.

        • name string

          Resource name

        • url string(uri)

          URL to resource

        • fromLesson boolean

          Whether this resource came from linked lesson or individual resource

      • commentCount integer

        Number of comments on post

      • submissionCount integer | null

        Number of submissions for assignment

      • isPinned boolean | null

        Whether post is pinned

      • allowComments boolean | null

        Whether comments allowed on post

      • createdAt string(date-time)

        When post/lesson was created

    • pagination object
      Hide pagination attributes Show pagination attributes object
      • currentPage

        The current page number (1-based indexing)

      • pageSize

        Number of items per page

      • totalItems

        Total number of items across all pages

      • totalPages

        Total number of available pages

  • 400 application/json

    Bad Request - Invalid query parameters

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

    Unauthorized

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

    Class not found

    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}/dashboard
curl \
 --request GET 'https://api.huy-devops.site/api/classes/{classId}/dashboard' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "success": true,
  "code": 200,
  "message": "string",
  "data": [
    {
      "itemType": "post",
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "classId": "550e8400-e29b-41d4-a716-446655440001",
      "title": "Quadratic Equations Assignment",
      "content": "Solve the following equations...",
      "author": {
        "id": "string",
        "firstName": "string",
        "lastName": "string",
        "avatarUrl": "string"
      },
      "type": "announcement",
      "dueDate": "2024-09-25T23:59:59Z",
      "maxPoints": 100,
      "attachments": [
        {
          "id": "550e8400-e29b-41d4-a716-446655440010",
          "type": "presentation",
          "name": "Quadratic Equations Guide",
          "url": "https://drive.google.com/file/d/abc123",
          "fromLesson": true
        }
      ],
      "commentCount": 5,
      "submissionCount": 23,
      "isPinned": false,
      "allowComments": true,
      "createdAt": "2024-09-21T10:00:00Z"
    }
  ],
  "pagination": {
    "currentPage": 1,
    "pageSize": 10,
    "totalItems": 100,
    "totalPages": 10
  }
}
Response examples (400)
{
  "success": false,
  "code": 42,
  "errorCode": "string",
  "message": "string",
  "timestamp": "2026-05-04T09:42:00Z"
}
Response examples (401)
{
  "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"
}