Get all books
curl --request GET \
--url https://bookhub-mock.onrender.com/books \
--header 'Authorization: Bearer <token>'import requests
url = "https://bookhub-mock.onrender.com/books"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://bookhub-mock.onrender.com/books', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://bookhub-mock.onrender.com/books",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://bookhub-mock.onrender.com/books"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://bookhub-mock.onrender.com/books")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://bookhub-mock.onrender.com/books")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"books": [
{
"bookId": "123e4567-e89b-41d4-a716-426614174000",
"title": "The Great Adventure",
"author": "Jane Smith",
"description": "A thrilling adventure story set in the mountains of Peru.",
"language": "en-US",
"publisher": "Adventure Books Inc",
"publishedDate": "2024-01-15",
"isbn": "978-0-1234-5678-9",
"price": 24.99,
"genres": [
"Fiction",
"Mystery",
"Thriller"
],
"bookFormat": "Hardcover",
"status": "ACTIVE",
"createdDate": "2024-12-25T10:30:00Z"
}
],
"pagination": {
"currentPage": 1,
"totalPages": 5,
"totalItems": 87,
"itemsPerPage": 20
}
}
}Endpoints
Get all books
Retrieves a paginated list of books for the authenticated publisher. If page exceeds totalPages, the API returns 200 OK with an empty books array.
v2 changes
- (breaking change): Title sorting has been removed. Use
createdDatefor sorting instead. - The
sortparameter now only acceptscreatedDate
Migration guide
If you were using sort=title:
- Replace with
sort=createdDate(recommended) - Implement client-side sorting if title ordering is required
GET
/
books
Get all books
curl --request GET \
--url https://bookhub-mock.onrender.com/books \
--header 'Authorization: Bearer <token>'import requests
url = "https://bookhub-mock.onrender.com/books"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://bookhub-mock.onrender.com/books', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://bookhub-mock.onrender.com/books",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://bookhub-mock.onrender.com/books"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://bookhub-mock.onrender.com/books")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://bookhub-mock.onrender.com/books")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"status": "success",
"data": {
"books": [
{
"bookId": "123e4567-e89b-41d4-a716-426614174000",
"title": "The Great Adventure",
"author": "Jane Smith",
"description": "A thrilling adventure story set in the mountains of Peru.",
"language": "en-US",
"publisher": "Adventure Books Inc",
"publishedDate": "2024-01-15",
"isbn": "978-0-1234-5678-9",
"price": 24.99,
"genres": [
"Fiction",
"Mystery",
"Thriller"
],
"bookFormat": "Hardcover",
"status": "ACTIVE",
"createdDate": "2024-12-25T10:30:00Z"
}
],
"pagination": {
"currentPage": 1,
"totalPages": 5,
"totalItems": 87,
"itemsPerPage": 20
}
}
}Authorizations
JWT obtained from the authentication endpoint
Query Parameters
Page number for pagination
Required range:
x >= 1Number of items per page
Required range:
x <= 100Filter by book status
Available options:
PENDING, ACTIVE, INACTIVE Sort field (v2 only supports createdDate)
Note: Title sorting has been removed in v2. Use createdDate instead.
Available options:
createdDate Sort order
Available options:
asc, desc Last modified on June 8, 2026