Skip to content

Lecture Material Endpoint

CristiPV edited this page Sep 12, 2021 · 9 revisions

Wiki ▸ Endpoints ▸ Lecture Material

Lecture Material

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

The Lecture Material endpoint is a representation of the lecture documents added to the application. The endpoint's purpose is to facilitate accessing, creating, updating and deleting these files.

Endpoints

GET /lecture-materials/

Retrieves all of the available lecture materials.

Sample Response

Status code: 200
Body:

[
  {
    "id": "cc327880f-9252-444b-94c2-b3b28c006",
    "document": "Fata_mosului_cea_cuminte_si_harnica_si_fata_babei_cea_haina_si_urata.pdf",
  },
  {
    "id": "b3b28c006-8883-9252-914a-cc327880f",
    "title": "Grammar_exercices.pdf",
  },
]

GET /lecture-materials/:id

Retrieves the lecture material with the provided id.

Parameters

Path Parameters

Path Parameter Description
:id The id of the lecture material entry.

Query Parameters

Sample Response

Status code: 200
Body:

{
  "id": "b3b28c006-8883-9252-914a-cc327880f",
  "title": "Grammar_exercices.pdf",
}

Status code: 404
Body:

{
    "error": "Not Found",
}

POST /lecture-materials/

Adds an entry composed in the body as a lecture material. If the document attribute is null or empty, it will return an error.

Parameters

Parameter Description
entry The new entry that will be added to the database .

Path Parameters

Query Parameters

Sample Response

Status code: 201
Body:

{
    "document": "Math_for_Vth_grade.pdf"
}

Response Body:

{
    "id": "61112f24-c44b-455a-9xxa-01ff2af1xx01",
    "document": "Math_for_Vth_grade.pdf"
}

Status code: 400
Body:

    "document":""

Response Body:

{
    "error": "Bad Request",
}

PATCH /lecture-materials/:id

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

Parameters

Parameter Description
entry The modified entry that will be updated in the database .

Path Parameters

Path Parameter Description
:id The id of the lecture material entry.

Query Parameters

Sample Response

Status code: 200
Body:

{
  "title": "Grammar_exercices_for_highschool.pdf",
}

Response Body:

{
    "id": "3b28c006-8883-9252-914a-cc327880f",
    "title": "Grammar_exercices_for_highschool.pdf"
}

Status code: 404
Body:

{
    "title": "Grammar_exercices_for_highschool.pdf"   
}

Response Body:

{
    "error": "Not Found",
}

Status code: 400
Body:

    "document":""

Response Body:

{
    "error": "Bad Request",
}

DELETE /lecture-materials/:id

Deletes the lecture material with the provided id.

Parameters

Path Parameters

Path Parameter Description
:id The id of the lecture material entry.

Query Parameters

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