Send a POST
request to /api/v1/books
Requires:
- Authorization header
- Book title
Note: The book's author
and about
informations are optional.
Server should answer successfully a status code 201
and a response body equals to:
{
id: ObjectId(),
title: "Book Title"
}
Send a GET
request to /api/v1/books
Requires:
- Authorization header
Server should answer successfully a status code 200
and a response body equals to:
[
{
"id": ObjectId(),
"user_id": ObjectId(),
"title": "Book Title",
"author": null,
"about": "about this book",
"section": null,
"created_at": "2023-11-15T19:49:29.536Z"
}
]
Send a PUT
request to /api/v1/books/{id}/info
Requires:
- Authorization header
- Book
title
,author
andabout
Note¹: If any of the fields are undefined
it throws an 400 error
.
Note²: If any of the fields are null
it updates to null
.
Server should answer successfully a status code 204
.
Send a PUT
request to /api/v1/books/{id}/section
Requires:
- Authorization header
- Book
section
Note¹: If section is undefined
it throws an 400 error
Note²: If section is null
it updates to null
Server should answer successfully a status code 204
.
Send a DELETE
request to /api/v1/books/{id}
Requires:
- Authorization header
Server should answer successfully a status code 204
.
Send a GET
request to /api/v1/users
Requires:
- Authorization header
Server should answer successfully a status code 200
and a response body equals to:
{
name: "user name",
email: "user email"
}
Send a PUT
request to /api/v1/users/email
Requires:
- Authorization header
- New email
Server should answer successfully a status code 204
and a access_token
cookie with an authentication token.
Send a PUT
request to /api/v1/users/password
Requires:
- Authorization header
- New password
Server should answer successfully a status code 204
.
Send a DELETE
request to /api/v1/users
Requires:
- Authorization header
Server should answer successfully a status code 204
.
Send a POST
request to /api/v1/auth/register
Requires:
- User name, email, and password
The server should answer successfully a status code 201
, an access_token
cookie with an authentication token, and a response body equals to:
{
email: "user@email",
name: "User name",
}
Send a POST
request to /api/v1/auth/login
Requires:
- User email and password
The server should answer successfully a status code 204
and a access_token
cookie with an authentication token.