Homework Resource
Get all homework
HTTP Request
GET /homeworks
Query String Parameters:
| Field | Type | Detail |
|---|---|---|
includeUser | boolean (optional) | whether to include author field in the response (optional) |
withDeleted | boolean | whether to include deleted/expired homework (optional) |
Response
200 OK
json
[
{
"id": number,
"subID": string,
"title": string,
"authorId": string,
"author": User,
"createdAt": Date,
"deletedAt": Date,
"dueDate": Date,
"detail": string
},
...
]
Explanation:
| Property | Detail |
|---|---|
id | number Homework ID |
subID | string Associated subject ID |
title | string Homework title |
authorId | string ID of user who created this homework |
author | User User who created this homework (only include when requested) |
createdAt | Date Creation date |
deletedAt | Date | null Deletion date |
dueDate | Date | null When this homework should be dued |
detail | string | null Detail explaning this homework |
Get single homework
HTTP Request
GET /homeworks/{id}
Query String Parameters:
| Field | Detail |
|---|---|
includeUser | boolean whether to include author field in the response (optional) |
Response
200 OK
json
{
"id": number,
"subID": string,
"title": string,
"authorId": string,
"author": User,
"createdAt": Date,
"deletedAt": Date,
"dueDate": Date,
"detail": string
}
Explanation:
| Property | Detail |
|---|---|
id | number Homework ID |
subID | string Associated subject ID |
title | string Homework title |
authorId | string ID of user who created this homework |
author | User User who created this homework (only include when requested) |
createdAt | Date Creation date |
deletedAt | Date | null Deletion date |
dueDate | Date | null When this homework should be dued |
detail | string | null Detail explaning this homework |
Create homework
WARNING
Authorization required!
HTTP Request
POST /homeworks
Body Parameters:
| Field | Detail |
|---|---|
title | string Homework title |
subject | string Subject ID |
detail | string (optional) Homework detail (max at 300 characters) |
dueDate | string (optional) Date string conforming to ISO8601 format standard |
Response
201 Created
json
{
"id": number,
"subID": string,
"title": string,
"authorId": string,
"createdAt": Date,
"deletedAt": Date,
"dueDate": Date,
"detail": string
}
Explanation:
| Property | Detail |
|---|---|
id | number Homework ID |
subID | string Associated subject ID |
title | string Homework title |
authorId | string ID of user who created this homework |
createdAt | Date Creation date |
deletedAt | Date | null Deletion date |
dueDate | Date | null When this homework should be dued |
detail | string | null Detail explaning this homework |
Modify homework
WARNING
Authorization required!
HTTP Request
PATCH /homeworks/{id}
Body Parameters:
| Field | Detail |
|---|---|
title | string (optional) Homework title |
subject | string (optional) Subject ID |
detail | string (optional) Homework detail (max at 300 characters) |
dueDate | string (optional) Date string conforming to ISO8601 format standard |
Response
200 OK
json
{
"id": number,
"subID": string,
"title": string,
"authorId": string,
"createdAt": Date,
"deletedAt": Date,
"dueDate": Date,
"detail": string
}
Explanation:
| Property | Detail |
|---|---|
id | number Homework ID |
subID | string Associated subject ID |
title | string Homework title |
authorId | string ID of user who created this homework |
createdAt | Date Creation date |
deletedAt | Date | null Deletion date |
dueDate | Date | null When this homework should be dued |
detail | string | null Detail explaning this homework |
Delete homework
WARNING
Authorization required!
HTTP Request
DELETE /homeworks/{id}
Response
200 OK
json
{
"id": number,
"subID": string,
"title": string,
"authorId": string,
"createdAt": Date,
"deletedAt": Date,
"dueDate": Date,
"detail": string
}
Explanation:
| Property | Detail |
|---|---|
id | number Homework ID |
subID | string Associated subject ID |
title | string Homework title |
authorId | string ID of user who created this homework |
createdAt | Date Creation date |
deletedAt | Date | null Deletion date |
dueDate | Date | null When this homework should be dued |
detail | string | null Detail explaning this homework |