drei-kr/espocrm-api

This package is abandoned and no longer maintained. No replacement package was suggested.

PHP API for EspoCRM

dev-master / 1.0.x-dev 2016-10-09 09:09 UTC

This package is not auto-updated.

Last update: 2022-05-14 07:03:45 UTC


README

Installation

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.

Composer example

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';

Usage

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.