This API is to provide users access to info on movies, their directors, and genres.
use the links below to find formatting, req.body requirements, and resposes from the API
Business Logic | URL | HTTP Method | Request Body Data Format | Response Body Data Format |
---|---|---|---|---|
Login | ||||
Log in user | /login | POST |
{
"Username": "kyle murphy",
"Password": "badPassword123", "email":"km@km.com" }
|
|
Users | ||||
Create new user | /users | POST |
{
"Username": "kyle murphy",
"Password": "badPassword123" }
|
{ "_id": "id#", "Username": "kyle murphy", "Password": "password hash", "email": "", "movieId": [], "__v": 0 } |
Add movie to users favorite | /users/:username | POST |
{
"movieId": "674248eba8270506fd0d8197" } |
{ "_id": "id#",
"Username": "##", "Password": "password hash", "email": "example@example.com", "movieId": [ "674248eba8270506fd0d8197", ], "__v": 0 } |
Update User info | /users/:username | PUT |
{ "Username": "kyle murphy", "Email": "test@email.com", "birthday": "1998-03-24", (YYYY-MM-DD) } |
{ "Username": "kyle murphy", "Email": "test@email.com", "birthday": "1998-03-24", (YYYY-MM-DD) "movieId": "234234235667" (movieIds) } |
Delete movie from user's list | /users/:id/:movieId | DELETE |
{ "Username": "kyle murphy", "email": "kmurph@nunya.com", "id": 1, "movieId": [] } |
|
Delete user | /users/:id | DELETE |
Accessed through params:
/users/9983545lk53sab |
|
Movies | ||||
Get all movies | /movies | GET |
[
{ "rating": 7, "title": "Gladiator", "genre": "Period", "director": { "name": "Ridley Scott", "birthday": "November 30th 1937", "death": "Alive" }, "image": "image.link" } ] |
|
Get single movie by title | /movies/:title | GET | accessed in Params e.g. ".../movies/gladiator" |
[
{ "rating": 7, "title": "Gladiator", "genre": "Period", "director": { "name": "Ridley Scott", "birthday": "November 30th 1937", "death": "Alive" }, "image": "image.link" } ] |
Get movies via genre association | /movies/genre/:genre | POST | accessed in Params e.g. ".../movies/genre/thriller" |
{
"rating": 8, "title": "The Last Samurai", "genre": "Period", "director": { "name": "Edward Zwick", "birthday": "October 8th 1952", "death": "Alive" }, "image": "image.link" } |
Get directors information | movies/director/:dirName | GET |
Accessed via Params e.g. ".../movies/directors/
edward%20zwick" |
{
"name": "Edward Zwick", "birthday": "October 8th 1952", "death": "Alive" } |