GET /api/v1/books
Retrieves a list of books with pagination.
Parameters
page: Page number for pagination. Default is1(int).limit: Number of books per page. Default is10(int).sort_type: Type of sorting based on a book characteristic. Default isid(str).sort_order: Sorting order of the results.1for ascending and-1for descending. Default is1(int).
Request
Response
The response will show books with the pagination specified. For example, if the pagination is page 1 and limit 1 there will be only one matching result (and the number of pages will be the number of books). Because the default sort type is "id" and in ascending order it will only show the first book added into the database.
{
"books": [
{
"_id": "6123d2c4a3490d001f2cf0db",
"id": 1,
"title": "Unlocking Android",
// More book information
}
],
"pageCurrent": 1,
"pagePrevious": null,
"pageNext": 2,
"pageLast": 37,
"items": 37
}