PHP code example of biblys / data-client-php
1. Go to this page and download the library: Download biblys/data-client-php library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
biblys / data-client-php example snippets
use Biblys\Data\Client;
$client = new Client();
$result = $client->getBook('9791091146134');
if (!$result) {
// Result if false, no book was found for this ISBN
} else {
echo $result->getTitle();
}
use Biblys\Data\Client;
use Biblys\Data\Book;
use Biblys\Data\Publisher;
$client = new Client([
"apiKey" => "YOUR_API_KEY" // Publisher();
$publisher->setName('Dystopia');
$book->setPublisher($publisher);
$author = new Contributor();
$author->setFirstName('Thomas');
$author->setLastName('Ligotti');
$book->addAuthor($author);
try {
$result = $client->push($book);
} catch (Exception $e) {
// Something went wrong
}