Skip to main content
This endpoint returns a single homework class by its ID, including all student submissions associated with that class. Use it to review the assignment details and the full list of student responses for a specific class.

Endpoint

GET /api/v3/admin/homeworks/{id}
Required role: Admin

Required Headers

HeaderValue
AuthorizationBearer <token>
Acceptapplication/json

Path Parameters

id
integer
required
The unique class ID. Must be a numeric value.
This route only accepts numeric IDs. Passing a non-numeric value — for example, /admin/homeworks/abc — returns a standard 404 response.

Example Request

curl -X GET https://app.example.com/api/v3/admin/homeworks/42 \
  -H "Authorization: Bearer your-token" \
  -H "Accept: application/json"

Response

200 OK

The example below shows a class with two submissions: one that has been reviewed and graded, and one that is still pending review.
{
  "id": 42,
  "title": "Lesson 3 — Algebra",
  "course_id": 5,
  "course_title": "Math Grade 10",
  "has_assignment": true,
  "assignment_deadline": "30/06/2026 11:59 PM",
  "assignment_description": "Solve problems 1-10 from chapter 3.",
  "assignment_file_url": "https://cdn.example.com/media/10/homework.pdf",
  "created_at": "2026-06-01 10:00:00",
  "submissions": [
    {
      "id": 101,
      "student_id": 77,
      "student_name": "Ahmed Ali",
      "student_email": "ahmed@example.com",
      "rating": 8,
      "instructor_comment": "Good work, but check question 4.",
      "is_reviewed": true,
      "submitted_at": "2026-06-05 14:30:00",
      "files": [{"id": 55, "name": "my_homework.pdf", "url": "https://cdn.example.com/media/55/my_homework.pdf"}],
      "download_url": "https://app.example.com/api/v3/assignments/download/101"
    },
    {
      "id": 102,
      "student_id": 88,
      "student_name": "Sara Mohamed",
      "student_email": "sara@example.com",
      "rating": null,
      "instructor_comment": null,
      "is_reviewed": false,
      "submitted_at": "2026-06-06 09:10:00",
      "files": [],
      "download_url": null
    }
  ]
}

Response Fields

id
integer
The unique class ID.
title
string
The title of the class.
course_id
integer
The ID of the parent course this class belongs to.
course_title
string | null
The title of the parent course. Returns null if the course has been deleted.
has_assignment
boolean
Indicates whether the class has a PDF homework assignment. Always true for classes returned by this endpoint.
assignment_deadline
string | null
The submission deadline for the assignment, formatted as dd/MM/YYYY hh:mm AM|PM. Returns null if no deadline was set.
assignment_description
string | null
The instructor’s written homework instructions. Returns null if no description was provided.
assignment_file_url
string | null
The URL to the instructor’s homework PDF file. Returns null if no file has been uploaded.
created_at
string
The timestamp when the class was created, formatted as YYYY-MM-DD HH:mm:ss.
submissions
array
Array of SubmissionObjects representing student homework submissions. Returns an empty array if no submissions exist.

Error Responses

StatusMessageCause
401UnauthorizedRequestMissing or invalid token, or the authenticated user does not have the Admin role.
404PDF Homework not foundNo class exists with the given ID, or the class has no PDF assignment attached.