If you haven't done so already, we recommend reading the Kotobee API Introduction.


The Library API lets you access the list of library books in your account, and view the contents and properties of each.



List libraries


https://www.kotobee.com/api/v1/library/all

Fetch the list of cloud ebooks or hosted ebooks in your account. Available variables are as follows.

serial
Contains your serial number
type
Whether fetch the list of cloud ebooks or hosted ebook. The value may be 'cloud' or 'hosted'. Default is 'cloud'
simple
If set to 1, only the following details will be fetched for each book: ID, name, and the either public (for cloud ebooks) or alias (for hosted ebooks)


Here's an example to list the cloud ebooks (with full details) for a user account

https://www.kotobee.com/api/v1/book/all?serial=1234-5678-9999-9999&type=cloud


An example of how to do it using POST variables with PHP:

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_RETURNTRANSFER => 1,
  CURLOPT_URL => "https://www.kotobee.com/api/v1/book/all",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_SSL_VERIFYPEER => false,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POST => true
));

$data = array();
$data["serial"] = "1234-5678-9999-9999";
$data["type"] = "cloud";
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);

$resp = curl_exec($curl);
//echo $resp;     //in case you want to view the result
curl_close($curl);


Get library


https://www.kotobee.com/api/v1/library/get

Fetch all books and properties of a library using its ID. Available variables are as follows.

serial
Contains your serial number
id
The library ID
simple
If set to 1, simplified details will be fetched


Here's an example to get simplified details of a library of ID 42

 

https://www.kotobee.com/api/v1/library/get?serial=1234-5678-9999-9999&id=42&simple=1


An example of how to do it using POST variables with PHP:

$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_RETURNTRANSFER => 1,
  CURLOPT_URL => "https://www.kotobee.com/api/v1/book/all",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_SSL_VERIFYPEER => false,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POST => true
));

$data = array();
$data["serial"] = "1234-5678-9999-9999";
$data["id"] = "42";
$data["simple"] = "1";
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);

$resp = curl_exec($curl);
//echo $resp;     //in case you want to view the result
curl_close($curl);