Video Library
A Video Library is a web app that consists of collection of Videos. Similar to Youtube, it can have features such as like videos, create playlists, add videos to playlists, history, feed, etc. but of a specific niche.
#
Auth RoutesIn Video Library App
, the authentication is done with email
and password
credential fields.
You can refer documentation related to Authentication here
#
Video RoutesThe following Routes are relating to Videos. These are Publicly accessible routes.
/api/videos
#
1. GET Request URL:
/api/videos
HTTP Method: GET
Response Body:
{ data: { videos: Array; }}
Functionality: This API call gets all videos from the db.
/api/video/:videoId
#
2. GET Request URL:
/api/video/:videoId
HTTP Method: GET
Response Body:
{ data: { video: Object; }}
Functionality: This API call gets video by videoId from the db.
#
Category RoutesThe following Routes are relating to Categories. These are Publicly accessible routes.
/api/categories
#
1. GET Request URL:
/api/categories
HTTP Method: GET
Response Body:
{ data: { categories: Array; }}
Functionality: This API call gets all categories from the db.
/api/categories/:categoryId
#
2. GET Request URL:
/api/categories/:categoryId
HTTP Method: GET
Response Body:
{ data: { category: Object; }}
Functionality: This API call gets category by categoryId from the db.
#
Auth RoutesYou can refer documentation related to Authentication here
#
Likes RoutesThe following Routes are relating to User's liked Videos. These are private routes.
/api/user/likes
#
1. GET Request URL:
/api/user/likes
HTTP Method: GET
Request Headers:
authorization: encodedToken
Response Body:
{ data: { likes: Array; }}
Functionality: This API call gets all liked videos of the user from the db.
/api/user/likes
#
2. POST Request URL:
/api/user/likes
HTTP Method: POST
Request Headers:
authorization: encodedToken
Request Body:
{ video;}
Response Body:
{ data: { likes: Array; }}
Functionality: This API call adds a video to the liked videos of the user in the db.
/api/user/likes/:videoId
#
3. DELETE Request URL:
/api/user/likes/:videoId
HTTP Method: DELETE
Request Headers:
authorization: encodedToken
Response Body:
{ data: { likes: Array; }}
Functionality: This API call removes a video from the liked videos of the user in the db.
#
Watch Later RoutesThe following Routes are relating to User's Watch Later Videos. These are private routes.
/api/user/watchlater
#
1. GET Request URL:
/api/user/watchlater
HTTP Method: GET
Request Headers:
authorization: encodedToken
Response Body:
{ data: { watchlater: Array; }}
Functionality: This API call gets all watch later videos of the user from the db.
/api/user/watchlater
#
2. POST Request URL:
/api/user/watchlater
HTTP Method: POST
Request Headers:
authorization: encodedToken
Request Body:
{ video;}
Response Body:
{ data: { watchlater: Array; }}
Functionality: This API call adds a video to the watch later videos of the user in the db.
/api/user/watchlater/:videoId
#
3. DELETE Request URL:
/api/user/watchlater/:videoId
HTTP Method: DELETE
Request Headers:
authorization: encodedToken
Response Body:
{ data: { watchlater: Array; }}
Functionality: This API call removes a video from the watch later videos of the user in the db.
#
Playlist RoutesThe following Routes are relating to User's Playlists and Playlisted Videos. These are private routes.
/api/user/playlists
#
1. GET Request URL:
/api/user/playlists
HTTP Method: GET
Request Headers:
authorization: encodedToken
Response Body:
{ data: { playlists: Array; }}
Functionality: This API call gets all the playlists of the user from the db.
/api/user/playlists
#
2. POST Request URL:
/api/user/playlists
HTTP Method: POST
Request Headers:
authorization: encodedToken
Request Body:
{ playlist: {title: "foo", description:"bar bar bar" }}
Response Body:
{ data: { playlists: Array; }}
Functionality: This API call creates a new playlist to the playlists of the user in the db.
/api/user/playlists/:playlistId
#
3. DELETE Request URL:
/api/user/playlists/:playlistId
HTTP Method: DELETE
Request Headers:
authorization: encodedToken
Response Body:
{ data: { playlists: Array; }}
Functionality: This API call deletes a playlist from the playlists of the user in the db.
/api/user/playlists/:playlistId
#
4. GET Request URL:
/api/user/playlists/:playlistId
HTTP Method: GET
Request Headers:
authorization: encodedToken
Response Body:
{ data: { playlist: Object; }}
Functionality: This API call gets playlist of the user from the db.
/api/user/playlists/:playlistId
#
5. POST Request URL:
/api/user/playlists
HTTP Method: POST
Request Headers:
authorization: encodedToken
Request Body:
{ video;}
Response Body:
{ data: { playlist: Array; }}
Functionality: This API call adds a new video to the playlist of the user in the db.
/api/user/playlists/:playlistId/:videoId
#
6. DELETE Request URL:
/api/user/playlists/:playlistId/:videoId
HTTP Method: DELETE
Request Headers:
authorization: encodedToken
Response Body:
{ data: { playlist: Array; }}
Functionality: This API call deletes a video from the playlist of the user in the db.
#
History RoutesThe following Routes are relating to User's History. These are private routes.
/api/user/history
#
1. GET Request URL:
/api/user/history
HTTP Method: GET
Request Headers:
authorization: encodedToken
Response Body:
{ data: { history: Array; }}
Functionality: This API call gets history of the user from the db.
/api/user/history
#
2. POST Request URL:
/api/user/history
HTTP Method: POST
Request Headers:
authorization: encodedToken
Request Body:
{ video;}
Response Body:
{ data: { history: Array; }}
Functionality: This API call adds a video to the history of the user in the db.
/api/user/history/:videoId
#
3. DELETE Request URL:
/api/user/history/:videoId
HTTP Method: DELETE
Request Headers:
authorization: encodedToken
Response Body:
{ data: { history: Array; }}
Functionality: This API call removes a video from the history of the user in the db.
/api/user/history/all
#
4. DELETE Request URL:
/api/user/history/all
HTTP Method: DELETE
Request Headers:
authorization: encodedToken
Response Body:
{ data: { history: Array; }}
Functionality: This API call clears the history of the user in the db.