Skip to main content
This endpoint returns a paginated list of every class that has a PDF homework assignment attached, along with all student submissions for each class. Use the query parameters to filter by course or control pagination.

Endpoint

GET /api/v3/admin/homeworks
Required role: Admin

Required Headers

HeaderValue
AuthorizationBearer <token>
Acceptapplication/json

Query Parameters

course_id
integer
Filter results to a specific course by its ID. Omit to return classes across all courses.
per_page
integer
default:"15"
Number of homework classes to return per page.
page
integer
default:"1"
Page number to retrieve.

Example Request

curl -X GET "https://app.example.com/api/v3/admin/homeworks?page=1&per_page=15" \
  -H "Authorization: Bearer your-token" \
  -H "Accept: application/json"

Response

200 OK

{
  "current_page": 1,
  "data": [
    {
      "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": null,
          "instructor_comment": null,
          "is_reviewed": false,
          "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"
        }
      ]
    }
  ],
  "first_page_url": "https://app.example.com/api/v3/admin/homeworks?page=1",
  "from": 1,
  "last_page": 3,
  "last_page_url": "https://app.example.com/api/v3/admin/homeworks?page=3",
  "next_page_url": "https://app.example.com/api/v3/admin/homeworks?page=2",
  "path": "https://app.example.com/api/v3/admin/homeworks",
  "per_page": 15,
  "prev_page_url": null,
  "to": 15,
  "total": 32
}

Response Fields

current_page
integer
The current page number in the paginated result set.
data
array
Array of HomeworkObject items representing classes with PDF homework assignments.
first_page_url
string
The full URL for the first page of results.
from
integer
The 1-based index of the first item on the current page.
last_page
integer
The number of the last available page.
last_page_url
string
The full URL for the last page of results.
next_page_url
string | null
The full URL for the next page of results. Returns null when you are on the last page.
path
string
The base URL of the endpoint, without pagination query parameters.
per_page
integer
The number of items returned per page, matching the per_page query parameter.
prev_page_url
string | null
The full URL for the previous page of results. Returns null when you are on the first page.
to
integer
The 1-based index of the last item on the current page.
total
integer
The total number of homework classes matching the query across all pages.

Error Responses

StatusMessageCause
401UnauthorizedRequestMissing or invalid token, or the authenticated user does not have the Admin role.