Skip to content

Homework Resource

Get all homework

HTTP Request

GET /homeworks

Query String Parameters:

FieldTypeDetail
includeUserboolean (optional)whether to include author field in the response (optional)
withDeletedbooleanwhether 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:

PropertyDetail
idnumber Homework ID
subIDstring Associated subject ID
titlestring Homework title
authorIdstring ID of user who created this homework
authorUser User who created this homework (only include when requested)
createdAtDate Creation date
deletedAtDate | null Deletion date
dueDateDate | null When this homework should be dued
detailstring | null Detail explaning this homework

Get single homework

HTTP Request

GET /homeworks/{id}

Query String Parameters:

FieldDetail
includeUserboolean 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:

PropertyDetail
idnumber Homework ID
subIDstring Associated subject ID
titlestring Homework title
authorIdstring ID of user who created this homework
authorUser User who created this homework (only include when requested)
createdAtDate Creation date
deletedAtDate | null Deletion date
dueDateDate | null When this homework should be dued
detailstring | null Detail explaning this homework

Create homework

WARNING

Authorization required!

HTTP Request

POST /homeworks

Body Parameters:

FieldDetail
titlestring Homework title
subjectstring Subject ID
detailstring (optional) Homework detail (max at 300 characters)
dueDatestring (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:

PropertyDetail
idnumber Homework ID
subIDstring Associated subject ID
titlestring Homework title
authorIdstring ID of user who created this homework
createdAtDate Creation date
deletedAtDate | null Deletion date
dueDateDate | null When this homework should be dued
detailstring | null Detail explaning this homework

Modify homework

WARNING

Authorization required!

HTTP Request

PATCH /homeworks/{id}

Body Parameters:

FieldDetail
titlestring (optional) Homework title
subjectstring (optional) Subject ID
detailstring (optional) Homework detail (max at 300 characters)
dueDatestring (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:

PropertyDetail
idnumber Homework ID
subIDstring Associated subject ID
titlestring Homework title
authorIdstring ID of user who created this homework
createdAtDate Creation date
deletedAtDate | null Deletion date
dueDateDate | null When this homework should be dued
detailstring | 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:

PropertyDetail
idnumber Homework ID
subIDstring Associated subject ID
titlestring Homework title
authorIdstring ID of user who created this homework
createdAtDate Creation date
deletedAtDate | null Deletion date
dueDateDate | null When this homework should be dued
detailstring | null Detail explaning this homework

Made with ❤️ and VitePress. Released under the MIT License.