PHP code example of icontact / booxtreamclient

1. Go to this page and download the library: Download icontact/booxtreamclient 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/ */

    

icontact / booxtreamclient example snippets




use \Icontact\BooXtreamClient\BooXtreamClient;
use \Icontact\BooXtreamClient\Options;
use \GuzzleHttp\Client;

// a guzzle client
$guzzle = new Client();

// an options object, refer to the documentation for more information on the options
$options = new Options([
    'customername' => 'Foo Bar',
    'referenceid' => 'bazdibzimgir12345',
    'languagecode' => 1033
]);

// create the BooXtream Client
$type = 'xml'; // returns downloadlinks
$credentials = ['username', 'apikey']; // you will need a username and an API key
$BooXtream = new BooXtreamClient($type, $options, $credentials, $guzzle);

// add a file location to the epub file you want to watermark
$BooXtream->setEpubFile('/path/to/your/file.epub');

// and send
$Response = $BooXtream->send();

$BooXtream->setStoredEpubFile('filename');

$BooXtream->setExlibrisFile('filename');

try {
  $Response = $BooXtream->send();
} catch (ClientException $e) {
  $Response = $e->getResponse();
}