UseDelight API

Backend API for the UseDelight apps to manage videos, settings, users, and authentication

Authentication 9

Routes for user authentication including register, login, reset password, etc.

Description

Generate password token and send email

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "email": "jun@gmail.com" }
Body
{ "email": "john@gmail.com", "password": "123456" }
Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "email": "john@gmail.com", "password": "123456" }
Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "email": "5f2a9c032289113018fc9add@usedelight.com", "password": "5f2a9c032289113018fc9add_Us3D37184+-pwd" }
Description

Add user to database with encrypted password

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "name": "John Doe", "email": "john@gmail.com", "password": "123456", "role": "publisher" }
Description

Reset user password using token

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "password": "123456" }
Description

Update logged in user name and email

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "name": "Jun Fabian", "email": "jun@gmail.com" }
Description

Update logged in user password, send in the body currentPassword and newPassword

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "currentPassword": "12345678", "newPassword": "123456" }

Ratings 6

Get, create, update, delete ratings.

Description

Add a rating for the video

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "video": "5f277dd9379a6f81e049696f", "isDisliked": true }
Description

Get all ratings from database. Advanced querying is supported.

Description

Update a rating in the database

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "isFavorite": false, "isDisliked": true }

Settings 1

Description

Send settings object and create new users if not existing.

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Users 5

Description

Add user to database (admin)

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "name": "Nate Smith", "email": "nate@gmail.com", "password": "123456" }
Description

Get all users (admin). Advanced querying is supported.

Description

Update user in database (admin)

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "name": "Nate Johnson" }

Videos 12

Videos CRUD functionality

Description

Add new video to database. Must be authenticated and must be publisher or admin

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

AuthorizationBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVmMjhmZWQ2ODViYTEyOWZjODVjYjUwMCIsImlhdCI6MTU5NjUyNDExOCwiZXhwIjoxNTk5MTE2MTE4fQ.vA20ziQrd2g152i3VYB0mpOoqInI_vOs2JxYpiI8Sfg
Body
{ "oldId": 1, "name": "TEST", "title": "Skyward", "author": "Keith Kiska", "type": "Nature", "tags": [], "duration": 10 }
Description

Fetch all videos from database. Includes pagination, filtering, etc. Advanced querying is supported.

Description

Fetch car videos. Advanced querying is supported.

Description

Fetch all videos of type “cars” and the provided tag

Description

Get a random number of videos. Optional parameters: favonly, minduration={duration in secs}, num

Query
KeyValueDescription
num20
favonlytrue
Description

Fetch nature videos. Advanced querying is supported.

Description

Fetch all videos with type “Nature” and the provided tag

Description

Update single video in database

Headers
KeyValueDescription
Content-Typeapplication/json

JSON Type

Body
{ "tags": ["ocean"] }
Description

Upload video file

Body
KeyValueDescription
file