PHPackages                             icontact/booxtreamclient - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. icontact/booxtreamclient

ActiveLibrary[API Development](/categories/api)

icontact/booxtreamclient
========================

A simple example client for the BooXtream webservice

v2.0.1(3y ago)31.6kMITPHPPHP &gt;=7.2.5

Since Nov 26Pushed 3y ago5 watchersCompare

[ Source](https://github.com/BooXtream/php-BooXtreamClient)[ Packagist](https://packagist.org/packages/icontact/booxtreamclient)[ Docs](https://github.com/BooXtream/php-BooXtreamClient/)[ RSS](/packages/icontact-booxtreamclient/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (3)Versions (11)Used By (0)

BooXtreamClient
===============

[](#booxtreamclient)

A client class in PHP for use with the BooXtream webservice.

- Has the ability to upload an epub file to the BooXtream webservice
- Alternatively specify an epub file stored on the BooXtream storage servers
- Can return an epub file, a (converted) mobi file or an xml containing one or more downloadlinks

### Installing via Composer

[](#installing-via-composer)

BooXtreamClient is available in Packagist, just add it to your composer.json

```
composer require icontact/booxtreamclient

```

or

```
{
    "require": {
        "icontact/booxtreamclient": "~2.0"
    }
}
```

Alternatively you can just download the package and run `composer install` to get the requirements.

The only requirements at the moment are PHP 7.2.5 and up and [Guzzle](http://guzzle.readthedocs.org/en/latest/index.html).

If you do not wish to use Composer you will need to fulfill the dependencies on your own.

### Usage

[](#usage)

You will need:

- a username and API key for the service
- an array of options (refer to the BooXtream web service API documentation)
- an epub file or a file stored on the BooXtream service

The type parameter can be either 'epub', 'mobi' or 'xml'. In the first two cases a file will be returned by the service, in the case of 'xml' you will receive one or two downloadlinks, depending on your settings (aka delivery platform).

```
require('vendor/autoload.php');

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);
```

We're now going to send the request.

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

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

A request with a stored file is slightly different. Instead of adding an epubfile you just need to provide the name of the file (with or without .epub extension):

```
$BooXtream->setStoredEpubFile('filename');
```

### Options

[](#options)

The available options are as follows. Refer to the API Documentation for details:

#### required:

[](#required)

- customername (string)
- customeremailaddress (string)
- referenceid (string)
- languagecode (int)

#### additionaly required if using xml (aka delivery platform):

[](#additionaly-required-if-using-xml-aka-delivery-platform)

- expirydays (int)
- downloadlimit (int)

#### optional:

[](#optional)

- exlibrisfont (string), this should contain either 'sans', 'serif' or 'script'
- exlibris (bool), default: false
- chapterfooter (bool), default: false
- disclaimer (bool), default: false
- showdate (bool), default: false

#### optional if using xml (aka delivery platform):

[](#optional-if-using-xml-aka-delivery-platform)

- epub (bool), default: true
- kf8mobi (bool), default: false

#### custom ex libris

[](#custom-ex-libris)

It is also possible to set a custom ex libris file according to the specifications in the API Documentation.

```
$BooXtream->setExlibrisFile('filename');
```

### Response

[](#response)

The BooXtreamClient returns an object of the type of [GuzzleHttp\\Psr7\\Response](https://docs.guzzlephp.org/en/latest/index.html)

The response always contains a statuscode (`$Response->getStatusCode();`). If the request was successful this will be 200. Any other status code is an error and will throw an Exception of the type of *GuzzleHttp\\Exception\\ClientException*. You can retrieve a Response object as follows:

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

Check the HTTP Reason (`$Response->getReasonPhrase();`) for more information.

#### Epub/Mobi

[](#epubmobi)

If you requested an epub or mobi file this can be accessed by reading the body (`$Response->getBody();`). The body is a stream, refer to the [PHP Documentation](http://php.net/stream) for more information on how to access it. Furthermore you can access the file's content-type with `$Response->getHeader('content-type');`.

#### XML or error

[](#xml-or-error)

If you requested xml (aka delivery platform) or if an error occurred more information can be found by accessing the body (`$Response->getBody();`). The body is a stream, refer to the [PHP Documentation](http://php.net/stream) for more information on how to access it.

The XML looks like this:

- Request, containing information about the request you made (options, etc)
- Response, containing either a set of downloadlinks or more information on an error

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~354 days

Recently: every ~707 days

Total

9

Last Release

1348d ago

Major Versions

v0.8.0 → v1.0.02016-01-08

v1.0.0 → v2.0.02021-10-25

PHP version history (2 changes)v1.0.0PHP &gt;=5.4.0

v2.0.0PHP &gt;=7.2.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/f44a1de94c69a79711632bd97333b5de734b0aecf7839ede7fe87f5d02df5413?d=identicon)[OmeBlues](/maintainers/OmeBlues)

---

Top Contributors

[![OmeBlues](https://avatars.githubusercontent.com/u/1052758?v=4)](https://github.com/OmeBlues "OmeBlues (50 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/icontact-booxtreamclient/health.svg)

```
[![Health](https://phpackages.com/badges/icontact-booxtreamclient/health.svg)](https://phpackages.com/packages/icontact-booxtreamclient)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
