Skip to content

Video Endpoint

Sebastian Badea edited this page Nov 25, 2021 · 3 revisions

Wiki ▸ Endpoints ▸ Video

Video

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

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

Endpoints

GET /videos/

Retrieves all of the available videos.

Sample Response

Status code: 200
Body:

[
    {
        "id": "da2a46ee-3332-4c30-aa32-c07c7130123c",
        "videoURL": "videoURL12",
        "videoTitle": "videoTitle12",
        "videoLength": "PT1M30S",
        "teacherURL": "teacherURL12",
        "teacherImageURL": "teacherImageURL13",
        "transcript": "transcript12",
        "summary": "summary12",
        "thumbnail": "thumbnail12"
    },
    {
        "id": "ae36de66-763a-4a1c-989c-662ea8086cb9",
        "videoURL": "videoURL10",
        "videoTitle": "videoTitle10",
        "videoLength": "PT1M30S",
        "teacherURL": "teacherURL10",
        "teacherImageURL": "teacherImageURL13",
        "transcript": "transcript12",
        "summary": "summary12",
        "thumbnail": "thumbnail12"
    }
]

GET /videos/:id

Retrieves the video with the provided id.

Parameters

Path Parameters

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

Sample Response

Status code: 200
Body:

{
    "id": "da2a46ee-3332-4c30-aa32-c07c7130123c",
    "videoURL": "videoURL12",
    "videoTitle": "videoTitle12",
    "videoLength": "PT1M30S",
    "teacherURL": "teacherURL12",
    "teacherImageURL": "teacherImageURL13",
    "transcript": "transcript12",
    "summary": "summary12",
    "thumbnail": "thumbnail12"
}

Status code: 404
Body:

{
    "error": "Not Found",
    "message": "GET: Video Not Found",
}

POST /videos/

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

Sample Response

Status code: 201
Request Body:

{
    "videoURL": "videoURL12",
    "videoTitle": "videoTitle12",
    "videoLength": 30,
    "teacherURL": "teacherURL12",
    "teacherImageURL": "teacherImageURL13",
    "transcript": "transcript12",
    "summary": "summary12",
    "thumbnail": "thumbnail12"
}

Response Body:

{
    "id": "4d357bac-ead4-43d5-a867-926e584f137c",
    "videoURL": "videoURL12",
    "videoTitle": "videoTitle12",
    "videoLength": "PT1M30S",
    "teacherURL": "teacherURL12",
    "teacherImageURL": "teacherImageURL13",
    "transcript": "transcript12",
    "summary": "summary12",
    "thumbnail": "thumbnail12"
}

Status code: 400
Request Body:

{
    "videoURL":""
}

Response Body:

{
    "error": "Bad Request",
    "message": "POST: Video invalid video URL.",
}

Status code: 400
Request Body:

{
    "videoTitle":""
}

Response Body:

{
    "error": "Bad Request",
    "message": "POST: Video invalid title.",
}

Status code: 400
Request Body:

{
    "videoLength":""
}

Response Body:

{
    "error": "Bad Request",
    "message": "POST: Video invalid length",
}

Status code: 400
Request Body:

{
    "videoLength":-1
}

Response Body:

{
    "error": "Bad Request",
    "message": "POST: Video invalid length",
}

Status code: 400
Request Body:

{
    "videoLength":0
}

Response Body:

{
    "error": "Bad Request",
    "message": "POST: Video invalid length",
}

Status code: 400
Request Body:

{
    "teacherURL":""
}

Response Body:

{
    "error": "Bad Request",
    "message": "POST: Video invalid teacher URL",
}

Status code: 400
Request Body:

{
    "transcript":""
}

Response Body:

{
    "error": "Bad Request",
    "message": "POST: Video invalid transcript",
}

Status code: 400
Request Body:

{
    "summary":""
}

Response Body:

{
    "error": "Bad Request",
    "message": "POST: Video invalid summary",
}

Status code: 400
Request Body:

{
    "thumbnail":""
}

Response Body:

{
    "error": "Bad Request",
    "message": "POST: Video invalid thumbnail",
}

PATCH /videos/:id

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

Parameters

Path Parameters

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

Sample Response

Status code: 200
Request Body:

{
    "videoURL": "videoURL17",
    "videoTitle": "videoTitle12",
    "videoLength": 30,
    "teacherURL": "teacherURL12",
    "teacherImageURL": "teacherImageURL13",
    "transcript": "transcript12",
    "summary": "summary12",
    "thumbnail": "thumbnail12"
}

Response Body:

{
    "id": "4a7f4336-e674-4f5b-8bd1-b4228f2fcab4",
    "videoURL": "videoURL17",
    "videoTitle": "videoTitle12",
    "videoLength": "PT30S",
    "teacherURL": "teacherURL12",
    "teacherImageURL": "teacherImageURL13",
    "transcript": "transcript12",
    "summary": "summary12",
    "thumbnail": "thumbnail12"
}

Status code: 404
Request Body:

{
    "videoURL": "videoURL17",
    "videoTitle": "videoTitle12",
    "videoLength": "PT30S",
    "teacherURL": "teacherURL12",
    "teacherImageURL": "teacherImageURL13",
    "transcript": "transcript12",
    "summary": "summary12",
    "thumbnail": "thumbnail12"
}

Response Body:

{
    "error": "Not Found",
    "message": "PATCH: Video Not Found",
}

Status code: 400
Request Body:

{
    "videoURL":""
}

Response Body:

{
    "error": "Bad Request",
    "message": "PATCH: Video invalid video URL.",
}

Status code: 400
Request Body:

{
    "videoTitle":""
}

Response Body:

{
    "error": "Bad Request",
    "message": "PATCH: Video invalid title.",
}

Status code: 400
Request Body:

{
    "videoLength":""
}

Response Body:

{
    "error": "Bad Request",
    "message": "PATCH: Video invalid length",
}

Status code: 400
Request Body:

{
    "videoLength":-1
}

Response Body:

{
    "error": "Bad Request",
    "message": "PATCH: Video invalid length",
}

Status code: 400
Request Body:

{
    "videoLength":0
}

Response Body:

{
    "error": "Bad Request",
    "message": "PATCH: Video invalid length",
}

Status code: 400
Request Body:

{
    "teacherURL":""
}

Response Body:

{
    "error": "Bad Request",
    "message": "PATCH: Video invalid teacher URL",
}

Status code: 400
Request Body:

{
    "transcript":""
}

Response Body:

{
    "error": "Bad Request",
    "message": "PATCH: Video invalid transcript",
}

Status code: 400
Request Body:

{
    "summary":""
}

Response Body:

{
    "error": "Bad Request",
    "message": "PATCH: Video invalid summary",
}

Status code: 400
Request Body:

{
    "thumbnail":""
}

Response Body:

{
    "error": "Bad Request",
    "message": "PATCH: Video invalid thumbnail",
}

DELETE /videos/:id

Deletes the video with the provided id.

Parameters

Path Parameters

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

Sample Response

Status code: 200
Body:

Status code: 404
Body:

{
    "error": "Not Found",
    "message": "DELETE: Video 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