1
0
mirror of synced 2024-11-27 15:56:06 +03:00
api-client-php/README.md

56 lines
956 B
Markdown
Raw Permalink Normal View History

2013-07-02 12:39:29 +04:00
IntaroCRM REST API client
2013-07-04 10:18:28 +04:00
=================
2013-07-02 12:37:54 +04:00
2013-07-02 12:39:29 +04:00
PHP Client for [IntaroCRM REST API](http://docs.intarocrm.ru/rest-api/).
2013-07-03 18:13:25 +04:00
2013-07-04 12:44:41 +04:00
Requirements
------------
2013-07-03 18:13:25 +04:00
2013-10-08 11:19:50 +04:00
* PHP version 5.3 and above
2013-07-03 18:13:25 +04:00
* PHP-extension CURL
2013-07-04 12:44:41 +04:00
Installation
------------
Add IntaroCRM REST API client in your composer.json:
```js
{
"require": {
2013-10-15 14:13:31 +04:00
"intarocrm/rest-api-client": "1.2.*"
2013-07-04 12:44:41 +04:00
}
}
```
Usage
------------
### Create API clent class
``` php
2013-07-04 17:03:35 +04:00
$crmApiClient = new \IntaroCrm\RestApi(
2013-10-08 11:19:38 +04:00
'https://demo.intarocrm.ru',
2013-07-04 17:03:35 +04:00
'T9DMPvuNt7FQJMszHUdG8Fkt6xHsqngH'
);
2013-07-04 12:44:41 +04:00
```
Constructor arguments are:
1. Your IntaroCRM acount URL-address
2. Your site API Token
2013-07-04 12:44:41 +04:00
### Example: get order types list
``` php
2013-10-15 14:11:57 +04:00
try {
$orderTypes = $crmApiClient->orderTypesList();
}
catch (\IntaroCrm\Exception\CurlException $e) {
//$logger->addError('orderTypesList: connection error');
}
catch (\IntaroCrm\Exception\ApiException $e) {
//$logger->addError('orderTypesList: ' . $e->getMessage());
}
2013-07-04 15:51:49 +04:00
2013-10-08 11:19:38 +04:00
```