myFlix Documentation: a REST API with node.js
A web application that 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.
Description | URL Endoint | HTTP Method | Request Body Format | Response Body Format |
---|---|---|---|---|
This endpoint will return a list of all the movies in the database | /movies | GET | None | A JSON object with data about all the movies. Example of JSON structure for one movie:
{ "Genre": { "Name": "Fantasy", "Description": "A genre of speculative fiction set in a fictional universe, often inspired by real world myth and folklore. Its roots are in oral traditions, which then became fantasy literature and drama." }, "Director": { "Name": "Chris Columbus", "Bio": "Born in Pennsylvania and raised in Ohio, Chris Columbus was first inspired to make movies after seeing 'The Godfather' at age 15.", "Birth": "1958" }, "Actors": [], "_id": "603851fd7778532c1f4fa159", "Title": "Harry Potter and the Chamber of Secrets", "Description": "An ancient prophecy seems to be coming true when a mysterious presence begins stalking the corridors of a school of magic and leaving its victims paralyzed", "ImagePath": "hpchamberofsecrets.png", "Featured": false } |
This endpoint will get information (description, genre, director, and image URL) about a single movie title | /movies/:Title | GET | None | JSON object with data about a specific movie with info about title, genre, and director. Example JSON structure:
{ "Genre": { "Name": "Fantasy", "Description": "A genre of speculative fiction set in a fictional universe, often inspired by real world myth and folklore. Its roots are in oral traditions, which then became fantasy literature and drama." }, "Director": { "Name": "Chris Columbus", "Bio": "Born in Pennsylvania and raised in Ohio, Chris Columbus was first inspired to make movies after seeing 'The Godfather' at age 15.", "Birth": "1958" }, "Actors": [], "_id": "603851fd7778532c1f4fa159", "Title": "Harry Potter and the Chamber of Secrets", "Description": "An ancient prophecy seems to be coming true when a mysterious presence begins stalking the corridors of a school of magic and leaving its victims paralyzed", "ImagePath": "hpchamberofsecrets.png", "Featured": false } |
Return data about the genre of a single movie by title | /movies/:Title/genres | GET | None | A JSON object with data about the genre of a movie, and description of genre. Example of JSON structure:
{ "Name": "Fantasy", "Description": "A genre of speculative fiction set in a fictional universe, often inspired by real world myth and folklore. Its roots are in oral traditions, which then became fantasy literature and drama." } |
This will return data about a movie director by name | /directors/:Name | GET | None | JSON object with data about director containing bio and birth year. Example JSON structure:
{ "Name": "Chris Columbus", "Bio": "Born in Pennsylvania and raised in Ohio, Chris Columbus was first inspired to make movies after seeing 'The Godfather' at age 15.", "Birth": "1958" } |
This allows new users to register | /users | POST | JSON object with data of a new user containing username, password and email. Example of JSON structure:
{ "Username" : "testuser123", "Password" : "password123", "Email" : "testing@gmail.com", "Birthday" : "09-10-20" } |
JSON object with data about user that was addded. Example JSON structure:
{ "FavoriteMovies": [], "_id": "603fe08ee4da91f97138e0fc", "Username": "testuser123", "Password": "password123", "Email": "testing@gmail.com", "Birthday": "2020-09-10T07:00:00.000Z", "__v": 0 } |
This will return data about one users profile | /users/:Username | GET | None | JSON object with data about user containing username, password, email and birthdate. Example JSON structure:
{ "FavoriteMovies": [], "_id": "603fe08ee4da91f97138e0fc", "Username": "testuser123", "Password": "password123", "Email": "testing@gmail.com", "Birthday": "2020-09-10T07:00:00.000Z", "__v": 0 } |
This allows users to update their info/username | /users/:Username | PUT | JSON object with updated info. Example JSON structure:
{ "Username" : "testuser123", "Password" : "passwordsupdated", "Email" : "testingnewemail@gmail.com", "Birthday" : "09-10-20" } |
JSON object with updated info. JSON structure example:
{ "FavoriteMovies": [], "_id": "603ec85e115174eb2b83b233", "Username": "testuser123", "Password": "passwordsupdated", "Email": "testingnewemail@gmail.com", "Birthday": "2020-09-10T07:00:00.000Z", "__v": 0 } |
This allows users to add a movie to their favorites list | /users/:Username/movies/:MovieID | POST | None | A text stating that the movie has been added to their favorites list. Example JSON structure:
{ "FavoriteMovies": [ "603851fd7778532c1f4fa159" ], "_id": "603ec85e115174eb2b83b233", "Username": "testuser123", "Password": "passwordsupdated", "Email": "testingnewemail@gmail.com", "Birthday": "2020-09-10T07:00:00.000Z", "__v": 0 } |
This allows users to remove movies from favorites | /users/:Username/movies/:MovieID | DELETE | None | A text stating that the movie has been removed. JSON structure example:
{ "FavoriteMovies": [], "_id": "603ec85e115174eb2b83b233", "Username": "testuser123", "Password": "passwordsupdated", "Email": "testingnewemail@gmail.com", "Birthday": "2020-09-10T07:00:00.000Z", "__v": 0 } |
This allows users to deactivate their account | /users/:Username | DELETE | None | A text stating the the user email/account has been removed and deactivated. Returns:
testuser123 was deleted. |