Introduction
Welcome to the documentation of this api. The api provides various functionalities for this movie application.
Below you will see the various endpoints that determine the functionalities.
Endpoints:
Movies
-
GET & /movies/
-
GET & /movies/{id}
- Returns the movie data for a specific movie
-
GET & /movies/{id}/rating
- Returns the rating value for a specific movie
To Watch List
-
GET & /towatchlist/entries
- Requires an API key and returns all entries on the user's toWatchList.
-
POST & /towatchlist/entries
- Requires an API key and all other data necessary for the toWatchList table, validates then inserts the data.
-
PUT & /towatchlist/entries/{id}
- Requires an API key and all other data necessary for the toWatchList table, replaces the entire record in the database (if there is no record it inserts and returns the appropriate HTTP code).
-
PATCH & /towatchlist/entries/{id}/priority
- Requires an API key and new priority, updates the user's priority for the appropriate movie.
-
DELETE & /towatchlist/entries/{id}
- Requires an API key and movieID, deletes the appropriate movie from the user's watchlist.
Completed Watch List
-
GET & /completedwatchlist/entries
- Requires an API key and returns all entries on the user's completedWatchList.
-
GET & /completedwatchlist/entries/{id}/times-watched
- Requires an API key and returns the number of times the user has watched the given movie.
-
GET & /completedwatchlist/entries/{id}/rating
- Requires an API key and returns the user's rating for this specific movie.
-
POST & /completedwatchlist/entries
- Requires an API key and all other data necessary for the completedWatchList table, validates then inserts the data. It also recomputes and updates the rating for the appropriate movie.
-
PATCH & /completedwatchlist/entries/{id}/rating
- Requires an API key and new rating, updates the rating for the appropriate movie in the completedWatchList table, then recalculates the movie's rating and updates the movies table.
-
PATCH & /completedwatchlist/entries/{id}/times-watched
- Requires an API key and increments the number of times watched and updates the last date watched of the appropriate movie.
-
DELETE & /completedwatchlist/entries/{id}
- Requires an API key and movieID, deletes the appropriate movie from the completedWatchList.
User
-
GET & /users/{id}/stats
- Returns basic watching stats for the provided user.
Additional Notes
Make sure to implement appropriate routing, request handling, and validation for each endpoint. Return proper HTTP status codes for success and failure scenarios.