Skip to content

Grade Endpoint

CristiPV edited this page Sep 27, 2021 · 3 revisions

Wiki ▸ Endpoints ▸ Grade

Grade

Contains data of all grades available on our e-learning platform.

The Grade endpoint is a representation of the grades added to the application.

Endpoints

GET /grades/

Retrieves all of the available grades.

Sample Response

Status code: 200
Body:

[
  {
    "id": "cc327880f-9252-444b-94c2-b3b28c006",
    "value": 7,
  },
  {
    "id": "b3b28c006-8883-9252-914a-cc327880f",
    "value": 8,
  },
]

GET /grades/:id

Retrieves the grades with the provided id.

Parameters

Path Parameters

Path Parameter Description
:id The id of the grade entry.

Sample Response

Status code: 200
Body:

{
  "id": "b3b28c006-8883-9252-914a-cc327880f",
  "value": 9,
}

Status code: 404
Body:

{
    "error": "Not Found",
}

POST /grades/

Adds an entry composed in the body as a grade. If the value attribute is null or not within these values: 1 to 12, it will return an error.

Sample Response

Status code: 201
Request Body:

{
    "grade": 5
}

Response Body:

{
    "id": "61112f24-c44b-455a-9xxa-01ff2af1xx01",
    "grade": 5
}

Status code: 400
Request Body:

    "grade": -1

Response Body:

{
    "error": "Bad Request",
}

PATCH /grades/:id

Sends an entity at the specified id with the grade entry that has been updated.

Parameters

Path Parameters

Path Parameter Description
:id The id of the grade entry.

Sample Response

Status code: 200
Request Body:

{
  "value": 10,
}

Response Body:

{
    "id": "3b28c006-8883-9252-914a-cc327880f",
    "grade": 10
}

Status code: 404
Request Body:

{
    "value": 10   
}

Response Body:

{
    "error": "Not Found",
}

Status code: 400
Body:

    "grade": -1

Response Body:

{
    "error": "Bad Request",
}

DELETE /grades/:id

Deletes the grade with the provided id.

Parameters

Path Parameters

Path Parameter Description
:id The id of the grade entry.

Sample Response

Status code: 200
Body:

Status code: 404
Body:

{
    "error": "Not Found",
}

Getting Started

Conventions

  1. General

  1. REST API

  1. E-Learning App

Endpoints

Custom Components

Themes

Packages Used

  1. Global

  1. REST API

  1. E-Learning App

Clone this wiki locally