The Package is available on Packagist (drei-kr/espocrm-api) and as such installable via Composer.
If you do not use Composer, you can grab the code from GitHub, and use any PSR-4 compatible autoloader (e.g. the Symfony ClassLoader component) to load the library's classes.
Add espocrm-api in your composer.json:
{
"require": {
"drei-kr/espocrm-api": "dev-master"
}
}
Download the library:
$ php composer.phar update drei-kr/espocrm-api
After installing, you need to require Composer's autoloader somewhere in your code:
require_once 'vendor/autoload.php';
use Drei\EspoCRM\Client\EspoClient;
$client = EspoClient::factory([
'url' => 'http://plus.dev/', // required
'username' => 'admin', // required
'token' => 'admin' // required
]);
$command = $client->getCommand('list', [
'entityType' => 'Account',
'maxSize' => 10
]);
$results = (array) $client->execute($command); // returns an array of results
You can find a list of the client's available commands in the bundle's client.json or take a look into the api docu of espocrm https://github.com/espocrm/documentation/blob/master/development/api.md.