List of endpoints exposed on https://rarog-django.vercel.app/api/
Handles POST requests to get media status for a user.
Requires a JSON body
{
"mediaId": String,
"userId": String
}
Returns a JSON body
{
"status": Boolean
}
In case of an error returns a response status 400.
Handles POST requests to change media status for a user.
Requires a JSON body
{
"mediaId": String,
"userId": String,
"status": Boolean
}
In case of an error returns a response status 400.
Handles multipart POST requests to create a new list for a user.
Image file (JPEG or PNG) is optional and should be labeled 'image'.
Required body:
{
"userId": String,
"category": String,
"name": String,
"description": String
}
In case of an error returns a response status 400.
Handles GET requests to get all media objects from list with <id>
id.
page-number
and page-size
are optional URL parameters for pagination.
search
is an optional URL parameter for search by title, genre and author.
Returns a JSON body:
Movies:
[
{
"id": String,
"media": {
"id": String,
"name": String,
"releaseYear": Integer,
"genre": String,
"imageId": String (or null)
},
"director": String
}
]
Books:
[
{
"id": String,
"media": {
"id": String,
"name": String,
"releaseYear": Integer,
"genre": String,
"imageId": String (or null)
},
"authors": String
}
]
In case of an error returns a response status 400.
Handles POST requests to add a media to list with <id>
id.
Requires a JSON body
{
"mediaId": String,
}
In case of an error returns a response status 400.
Handles DELETE requests to remove a media from list with <id>
id.
Requires a JSON body
{
"mediaId": String,
}
In case of an error returns a response status 400.
Handles GET requests to get details of user with <id>
id.
Returns a JSON body:
{
"username": String,
"city": {
"id": String,
"name": String
},
"lists": [
{
"id": String,
"name": String,
"category": {
"name": String
},
"description": String,
"imageId": String (or null)
},
]
}
In case of an error returns a response status 400.
Handles POST requests to rate a media.
Requires a JSON body
{
"mediaId": String,
"userId": String,
"comment": String,
"rating": Integer
}
If successful returns a JSON body with response status 201.
{
"id": String
}
In case of an error returns a response status 400.
Handles multipart POST requests to create a new media within <categoryName>
category.
Image file (JPEG or PNG) is optional and should be labeled 'image'.
Required body:
Movies:
{
"name": String,
"releaseYear": Integer,
"genre": String,
"director": String,
"cast": String,
"length": Integer,
"description": String,
"screenwriters": String
}
Books:
{
"name": String,
"releaseYear": Integer,
"genre": String,
"authors": String,
"description": String
}
If successful returns a JSON body with response status 201.
{
"id": String
}
In case of an error returns a response status 400.
Handles GET requests to get details on one media from chosen category.
If successful returns a JSON body with response status 200.
Movies:
{
"id": String,
"media": {
"id": String,
"name": String,
"releaseYear": Integer,
"genre": String,
"imageId": String
},
"director": String,
"cast": String,
"length": Integer,
"description": String,
"screenwriters": String,
"ratings": [
{
"id": String,
"user": String,
"comment": String,
"rating": Integer
}
]
}
Books:
{
"id": String,
"media": {
"id": String,
"name": String,
"releaseYear": Integer,
"genre": String,
"imageId": String (or null)
},
"authors": String,
"description": String,
"ratings": [
{
"id": String,
"user": String,
"comment": String,
"rating": Integer
}
]
}
In case of an error returns a response status 400.
Handles GET requests to get all media objects from the <categoryName>
category.
page-number
and page-size
are optional URL parameters for pagination.
search
is an optional URL parameter for search by title, genre and author.
Returns a JSON body:
Movies:
[
{
"id": String,
"media": {
"id": String,
"name": String,
"releaseYear": Integer,
"genre": String,
"imageId": String (or null)
},
"director": String
}
]
Books:
[
{
"id": String,
"media": {
"id": String,
"name": String,
"releaseYear": Integer,
"genre": String,
"imageId": String (or null)
},
"authors": String
}
]
In case of an error returns a response status 400.
Returns an array of cities in JSON
[
{
"id": String,
"name": String
}
]
Handles POST requests to create a new user.
Requires a JSON body
{
"username": String,
"password": String,
"email": String,
"city": String
}
If successful returns the "userId" with response status 201.
In case of an error returns a response status 400 and a list with field names as keys and list of errors which occured on that field as values.
Handles POST requests for logging in a user.
Requires a JSON body
{
"username": String,
"password": String
}
If successful returns the "userId" with response status 200.
In case of an error returns a response status 400 and a list with field names as keys and list of errors which occured on that field as values.