https://github.com/espocrm/php-espo-api-client
PHP API client for EspoCRM
https://github.com/espocrm/php-espo-api-client
api-client espocrm php
Last synced: 22 days ago
JSON representation
PHP API client for EspoCRM
- Host: GitHub
- URL: https://github.com/espocrm/php-espo-api-client
- Owner: espocrm
- License: mit
- Created: 2022-12-23T12:20:08.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-11-25T08:16:30.000Z (7 months ago)
- Last Synced: 2025-06-09T12:11:31.114Z (25 days ago)
- Topics: api-client, espocrm, php
- Language: PHP
- Homepage:
- Size: 19.5 KB
- Stars: 17
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# PHP EspoCRM API client
Require with Composer:
```
composer require espocrm/php-espo-api-client
```## Usage
```php
use Espo\ApiClient\Client;
use Espo\ApiClient\Header;
use Espo\ApiClient\Exception\ResponseError;$client = new Client($yourEspoUrl);
$client->setApiKey($apiKey);
$client->setSecretKey($secretKey); // if you use HMAC methodtry {
$response = $client->request(
Client::METHOD_POST,
'Lead',
[
'firstName' => $firstName,
'lastName' => $lastName,
'emailAddress' => $emailAddress,
],
[new Header('X-Skip-Duplicate-Check', 'true')]
);
$parsedBody = $response->getParsedBody();
} catch (ResponseError $e) {
// Error response.
$response = $e->getResponse();
$code = $response->getCode();
$body = $response->getBodyPart();// Consider using some additional library if you need parsed response headers.
}
```## Changelog
### 1.0.0
* Using new method for constructing *X-Hmac-Authorization* header https://github.com/espocrm/php-espo-api-client/issues/2