This API is intended to serve the clients of Readers Hub application.
- Adds a new user
- Request arguments: None
- Authorization: Not required
- Request body:
{
"name": "String: User's display name",
"email": "String: User's email",
"password": "String: User's password",
}
- Response body:
{
"user": {
"uid": "Integer: User's unique id",
"email": "String: User's email",
"name": "String: User's name"
},
"access_token": "JWT token"
}
- Authenticate the user
- Request arguments: None
- Authorization: Not required
- Request body:
{
"email": "String: User's email",
"password": "User's password"
}
- Response body:
{
"access_token": "String: JWT Token"
}
- Gets books matching search query
- Request arguments:
q=search_query
- Authorization: Not required
- Response body:
{
"books": "Array of books"
}
- Gets a specific book
- Request arguments: None
- Request parameters:
book_id: The unique identifier of the book
- Authorization: Not required
- Response body:
{
"book": {/* book data */}
}
- Updates the reading progress of the reader for this book
- Request arguments: None
- Request parameters:
book_id: The unique identifier for the book
- Authorization: Required
- Request body:
{
"progress": "Integer: The percentage of the reading progress"
}
- Response body:
{
"book_id": "Integer: The id of the book",
"uid": "Integer: The unique identifier of the user"
"progress": "Integer: The new progress after modification"
}
- Adds a review to the book
- Request arguments: None
- Request parameters:
book_id: The unique identifier for the book
- Authorization: Required
- Request body:
{
"rating": "Integer: Rating on the scale from 1 to 5",
"comment": "String: Review comment"
}
- Response body:
{
"book_id": "Integer: Book id",
"uid": "Integer: The unique identifier of the user",
"review": {
"rating": "The new rating",
"comment": "The new review comment"
}
}
- Gets all the lists of a user
- Request arguments: None
- Request parameters:
user_id=the unique id of the user
- Authorization: Optional
- Response body:
{
"lists": "Array of lists",
"uid": "User id"
}
- Creates a new list
- Request arguments: None
- Authorization: Required
- Request body:
{
"name": "String: The name of the list"
}
- Response body:
{
"list": {
"id": "Integer: the id of the list",
"name": "The name of list",
"owner_id": "Integer: the unique id of the user owning the list",
"list_type": "String: The type of the list"
}
}
- Updates the info of a list
- Request arguments: None
- Request parameters:
list_id: the unique id of the list
- Authorization: Required
- Request body:
{
"list": {/* The object contains new data */}
}
- Response body:
{
"list": {/* List data after modification */}
}
- Deletes a list
- Request arguments: None
- Request parameters:
list_id: the unique id of the list
- Authorization: Required
- Response body:
{
"list_id": "Integer: The id of the deleted list"
}
- Gets all the books of a list
- Request arguments: None
- Request parameters:
list_id: The unique identifier of the list
- Authorization: Required
- Response body:
{
"list_id": "Integer: The unique id of the list",
"books": "Array: The books in the list"
}
- Adds a book to a list
- Request arguments: None
- Request parameters:
list_id: The unique identifier of the list
- Authorization: Required
- Response body:
{
"list_id": "Integer: The unique identefier of the list",
"book_id": "Integer: The id of the added book"
}
- Get the challenges of the user
- Request arguments: None
- Request parameters:
user_id: The unique of the user
- Authorization: Required
- Response body:
{
"challenges": "Array of the challenges of the user"
}
- Creates a new challenge
- Request arguments: None
- Request parameters: None
- Authorization: Required
- Request body:
{
"name": "String: The name of the challenge",
"start_time": "DateTime: The start time of the challenge",
"end_time": "DateTime: The time the challenge ends",
"target_books": "Integer: The target of the books read the participants have to reach",
"type": "Enum('public', 'private')"
}
- Response body:
{
"challenge": {
"id": "Integer: The unique id of the challenge",
"creator_id": "Integer: The unique id of the user created it".
"name": "String: The name of the challenge",
"start_time": "DateTime: The start time of the challenge",
"end_time": "DateTime: The time the challenge ends",
"target_books": "Integer: The target of the books read the participants have to reach",
"chhallenge_type": "Enum('public', 'private')
}
}
- Joins the user who made the request the challenge
- Request arguments: None
- Request parameters:
challenge_id: The unique id of the challenge
- Authorization: Required
- Request body:
{}
- Response body:
{
"uid": "Integer: The unique id of the user",
"challenge_id": "Integer: The unique id of the challenge"
}