Skip to content

rizkysaputra4/movidb-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API ROUTE

AUTH Endpoint


METHOD /auth

This route is used to handle auth related like check username, check email, register, etc. This route also open to public.

 

Check Username

route to check if username exist. thiis route will giving error response when username exist

POST /auth/register-username

json body example:

{
  "user_name": "movidb"
}

Check Email

route to check if email exist. this route will giving error response when email exist

POST /auth/register-email

json body example:

{
  "email": "[email protected]"
}

Register

route that added user into db.

POST /auth/register

json body example:

{
  "user_name": "movidb",
  "email": "[email protected]",
  "country_id": "id",
  "password": "movidb",
  "email": "[email protected]"
}

Login / Check

to check if username or email exist.

POST /auth/login-username

json body example:

{
  "user_name": "movidb"
}

or

{
  "email": "[email protected]"
}

Login / Check if Passowrd Match

to check if password match.

POST /auth/login-password

json body example:

{
  "user_name": "movidb",
  "password": "movidb"
}

or

{
  "email": "movidb",
  "password": "movidb"
}

Logout

Clean user cookies.

GET /auth/logout

 

Admin Endpoint

This route only available for admin.

 

Register new admin

Admin add new admin with registering new account.

POST /admin/register-new-admin

json body example:

{
  "user_name": "newadmin",
  "email": "[email protected]",
  "country_id": "id",
  "password": "movidb",
  "email": "[email protected]",
  "role": "6"
}

 

CHANGE LEVEL

This route used for changing authority level (role). note: admin cannot modify userID that have role higher than him, or change some role higher than his role.

PUT /admin/admin-level

json body example:

{
  "user_id": 6,
  "role": 10
}

 

New Identifier

Identifier used to identify whether review, comment, etc. is blocked, in review, online, etc.

POST /admin/new-identifier

json body example:

{
  "info": "blocked"
}

 

Get Admin List

Get List of admin

GET /admin/admin-list

 

Search User

Search user

GET /admin/user/search?uid=admin&limit=2&offset=0

 

Add New Movie Type

Type is to identify is it movie, kdrama, or anime

POST /admin/movie/add-new-movie-type

json body example:

{
  "type_name": "tv-series"
}

 

Add New Movie

Inserting new movie into db.

POST /admin/movie/new-movie

json body example:

{
  "movie_title": "iron man",
  "movie_synopsis": "synopis",
  "release_date": "10 jan 2010",
  "imdb_rating": 10,
  "imdb_num_vote": 1000,
  "metacritics": 4,
  "poster_link": "",
  "trailer_link": "youtube.com",
  "duration": "10 minutes",
  "awards": "",
  "type_id": 1,
  "country_id": "id",
  "language": "id",
  "unique_link": "iron-man",
  "identifier_id": 1
}

 

Edit Movie

Edit Movie.

PUT /admin/movie/edit-movie

json body example:

{
  "movie_title": "iron man",
  "movie_synopsis": "synopis",
  "release_date": "10 jan 2010",
  "imdb_rating": 10,
  "imdb_num_vote": 1000,
  "metacritics": 4,
  "poster_link": "",
  "trailer_link": "youtube.com",
  "duration": "10 minutes",
  "awards": "",
  "type_id": 1,
  "country_id": "id",
  "language": "id",
  "unique_link": "iron-man",
  "identifier_id": 1
}

 

Add New People Role

The table contains all role in movie industry like actress, actor, director, etc.

POST /admin/movie/new-people-role

json body example:

{
  "role_name": "writer"
}

 

Update New People Role

The table contains all role in movie industry like actress, actor, director, etc.

POST /admin/movie/update-people-role

json body example:

{
  "role_id": 1,
  "role_name": "actress"
}

 

USER ENDPOINT

Route that accessible by user or registered member.

 

Update user full info

Route to update user information like, birthdate, social media link, etc.

PUT /user/{user-id}
{
  "user_full_name": "john Doe",
  "birthdate": "1 January 2020",
  "bio": "movie lovers",
  "fb_link": "facebook.com",
  "twitter_link": "twitter.com",
  "ig_link": "ig.com",
  "sex": true
}

for sex variable: true equal to male, false equal to female

 

PUBLIC ENDPOINT

 

Get My Role

GET /public/my-role

This will return your role in number 1 - 99

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published