Skip to content

Lecture Endpoint

Yan_Badea edited this page Sep 26, 2021 · 4 revisions

Wiki ▸ Endpoints ▸ Lecture

Lecture

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

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

Endpoints

GET /lectures/

Retrieves all of the available lectures.

Sample Response

Status code: 200
Body:

[
  {
    "id": "cc327880f-9252-444b-94c2-b3b28c006",
    "title": "Vectors and Spaces",
  },
  {
    "id": "b3b28c006-8883-9252-914a-cc327880f",
    "title": "Foundations of American Democracy",
  },
]

GET /lectures/:id

Retrieves the lecture with the provided id.

Parameters

Path Parameters

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

Sample Response

Status code: 200
Body:

{
  "id": "b3b28c006-8883-9252-914a-cc327880f",
  "title": "Civil liberties and civil rights",
}

Status code: 404
Body:

{
    "error": "Not Found",
}

POST /lectures/

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

Sample Response

Status code: 201
Request Body:

{
    "title": "Adding decimals"
}

Response Body:

{
    "id": "61112f24-c44b-455a-9xxa-01ff2af1xx01",
    "title": "Adding decimals"
}

Status code: 400
Request Body:

    "title":""

Response Body:

{
    "error": "Bad Request",
}

PATCH /lectures/:id

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

Parameters

Path Parameters

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

Sample Response

Status code: 200
Request Body:

{
  "title": "Exponents",
}

Response Body:

{
    "id": "3b28c006-8883-9252-914a-cc327880f",
    "title": "Exponents"
}

Status code: 404
Request Body:

{
    "title": "Exponents2"   
}

Response Body:

{
    "error": "Not Found",
}

Status code: 400
Body:

    "title":""

Response Body:

{
    "error": "Bad Request",
}

DELETE /lectures/:id

Deletes the lecture with the provided id.

Parameters

Path Parameters

Path Parameter Description
:id The id of the lecture 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