Movie API Documentation


This is the server-side component of a "movies" web application. The web application will provide users with access to information about different movies, directors, and genres. Users will be able to sign up, update their personal information, and create a list of their favorite movies.

Business Logic URL HTTP Method CRUD Operation Request body data format Response body data format
1 Return a list of ALL movies to the user /movies GET READ None A JSON object holding data about all the movies. Example: [{ "Genre": { "Name": "Thriller", "Description": "Thriller film, also known as suspense film or suspense thriller, is a broad film genre that involves excitement and suspense in the audience." }, "Director": { "Name": "Jonathan Demme", "Bio": "Jonathan Demme was born on February 22, 1944 in Baldwin, Long Island, New York, USA. He was a director and producer, known for The Silence of the Lambs (1991), Philadelphia (1993) and Rachel Getting Married (2008). ", "Birth": "1944-02-22T00:00:00.000Z", "Death": "2017-04-26T00:00:00.000Z" }, "_id": "6582042062ad0d41a80d78da", "Title": "Silence of the Lambs", "Description": "A young FBI cadet must receive the help of an incarcerated and manipulative cannibal killer.", "ImagePath": "silenceofthelambs.png", "Featured": true, "Year": "1991" }]
2 Return data (description, genre, director, image URL, whether it's featured or not) about a single movie by title to the user /movies/:title GET READ None A JSON object holding data about a single movie, containing an ID, name, and classes property. Example: { "Genre": { "Name": "Drama", "Description": "Drama is a category or genre of narrative fiction (or semi-fiction) intended to be more serious than humorous in tone." }, "Director": { "Name": "Jonathan Demme", "Bio": "Jonathan Demme was born on February 22, 1944 in Baldwin, Long Island, New York, USA. He was a director and producer, known for The Silence of the Lambs (1991), Philadelphia (1993) and Rachel Getting Married (2008). ", "Birth": "1944-02-22T00:00:00.000Z", "Death": "2017-04-26T00:00:00.000Z" }, "_id": "658390c2d017ea52f29e56c4", "Title": "Philadelphia", "Description": "When a man with HIV is fired by his law firm because of his condition, he hires a homophobic small time lawyer as the only willing advocate for a wrongful dismissal suit.", "Year": "1993", "ImagePath": "philadelphia.png", "Featured": false }
3 Return data about a genre (description) by name/title (e.g., “Thriller”) /movies/genres/:genreName GET READ None A JSON object holding data about a single genre, containing the name/title and description. Example: { "Name": "Drama", "Description": "Drama is a category or genre of narrative fiction (or semi-fiction) intended to be more serious than humorous in tone." }
4 Return data about a director (bio, birth date, death date) by name /movies/directors/:directorName GET READ None A JSON object holding data about a single director , containing the name, bio, birth date, and death date (if applicable). Example: { "Name": "Rob Minkoff", "Bio": "Robert Ralph Minkoff is an American filmmaker. He is known for directing the double Academy Award–winning animated feature The Lion King, along with directing Stuart Little.", "Birth": "1962-08-11T00:00:00.000Z", "Death": null }
5 Return a user by their username /users/:username GET READ None A JSON object holding data about a single user. Example: { "user": { "_id": "65af1953ba0be72c4872e8e1", "Username": "patrickstar", "Password": "$2b$10$F.ev0t5GGpe19vd0iv2fH.1NiMsJ6aPUW03LB5GFtb6md8xP/SJ4C", "Email": "underarock@email.com", "Birthday": "1999-05-01T00:00:00.000Z", "FavoriteMovies": [], "__v": 0 }, }
6 Allow new users to register /users POST CREATE A JSON object holding data about the new user to add, structured like: { "Username": "sandycheeks", "Password": "heeyah!", "Email": "squirrelpower@email.com", "Birthday": "1998-08-08" } A JSON object holding data about the new user that was added, including an ID: { "user": { "_id": "65af190aba0be72c4872e8de", "Username": "sandycheeks", "Password": "$2b$10$R2uY8Ke8gE/8fFqaByyeHOXUSIXKxyaapiWemjqaoysY5MWH95LSa", "Email": "squirrelpower@email.com", "Birthday": "1998-08-08T00:00:00.000Z", "FavoriteMovies": [], "__v": 0 }, }
7 Allow users to update their user info (username, password, email, birthday) /users/:username PUT UPDATE A JSON object holding data about the user to be updated. Example: { "Username": "sandycheeks", "Password": "heeyah!", "Email": "squirrelpower@email.com", "Birthday": "1998-08-08" } A JSON object holding data about the user that was updated. Example: { "user": { "_id": "65af190aba0be72c4872e8de", "Username": "sandycheeks", "Password": "$2b$10$R2uY8Ke8gE/8fFqaByyeHOXUSIXKxyaapiWemjqaoysY5MWH95LSa", "Email": "squirrelpower@email.com", "Birthday": "1998-08-08T00:00:00.000Z", "FavoriteMovies": [], "__v": 0 }, }
8 Allow users to add a movie to their list of favorites /users/:username/movies/:MovieID POST UPDATE None A JSON object holding data showing the movie added to the user's favorite list. Example: { "user": { "_id": "65af190aba0be72c4872e8de", "Username": "sandycheeks", "Password": "$2b$10$R2uY8Ke8gE/8fFqaByyeHOXUSIXKxyaapiWemjqaoysY5MWH95LSa", "Email": "squirrelpower@email.com", "Birthday": "1998-08-08T00:00:00.000Z", "FavoriteMovies": ["65838e76d017ea52f29e56c1"], "__v": 0 }, }
9 Allow users to remove a movie from their list of favorites /users/:username/movies/:MovieID DELETE UPDATE None A JSON object holding data showing the movie was removed from the user's favorite list. Example: { "user": { "_id": "65af190aba0be72c4872e8de", "Username": "sandycheeks", "Password": "$2b$10$R2uY8Ke8gE/8fFqaByyeHOXUSIXKxyaapiWemjqaoysY5MWH95LSa", "Email": "squirrelpower@email.com", "Birthday": "1998-08-08T00:00:00.000Z", "FavoriteMovies": [], "__v": 0 }, }
10 Allow existing users to deregister (showing only a text that a user has been removed) /users/:username DELETE DELETE None A text message indicating the user was removed from the database
11 Allow existing users to login and get a JWT token /login/:username:password POST CREATE None A JSON object holding data about a single user and their JWT token. Example: { "user": { "_id": "65af1953ba0be72c4872e8e1", "Username": "patrickstar", "Password": "$2b$10$F.ev0t5GGpe19vd0iv2fH.1NiMsJ6aPUW03LB5GFtb6md8xP/SJ4C", "Email": "underarock@email.com", "Birthday": "1999-05-01T00:00:00.000Z", "FavoriteMovies": [], "__v": 0 }, "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NWFmMTk1M2JhMGJlNzJjNDg3MmU4ZTEiLCJ1c2VybmFtZSI6InBhdHJpY2tzdGFyIiwicGFzc3dvcmQiOiIkMmIkMTAkRi5ldjB0NUdHcGUxOXZkMGl2MmZILjFOaU1zSjZhUFVXMDNMQjVHRnRiNm1kOHhQL1NKNEMiLCJlbWFpbCI6InVuZGVyYXJvY2tAZW1haWwuY29tIiwiYmlydGhfZGF0ZSI6IjE5OTktMDUtMDFUMDA6MDA6MDAuMDAwWiIsIkZhdm9yaXRlTW92aWVzIjpbXSwiX192IjowLCJpYXQiOjE3MDU5NzU0MzUsImV4cCI6MTcwNjU4MDIzNSwic3ViIjoicGF0cmlja3N0YXIifQ.3JpO2kXdvW3wCoy1aN4Fh1FXqJNsD8EtCxv8PavFC4s" }