https://github.com/pashamesh/uiscom-api-client
UisCom (formerly CoMagic) Data API and Call API PHP client
https://github.com/pashamesh/uiscom-api-client
api-client call-api comagic data-api php php-sdk uis uiscom
Last synced: 2 months ago
JSON representation
UisCom (formerly CoMagic) Data API and Call API PHP client
- Host: GitHub
- URL: https://github.com/pashamesh/uiscom-api-client
- Owner: pashamesh
- License: mit
- Created: 2017-01-24T12:30:38.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2025-11-09T12:40:35.000Z (3 months ago)
- Last Synced: 2025-11-09T14:35:11.034Z (3 months ago)
- Topics: api-client, call-api, comagic, data-api, php, php-sdk, uis, uiscom
- Language: PHP
- Homepage:
- Size: 47.9 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# [UIScom](https://www.uiscom.ru/) (formerly [CoMagic](https://main.comagic.ru/)) API PHP client
[](https://github.com/pashamesh/uiscom-api-client/actions/workflows/tests.yml)
[](https://github.com/pashamesh/uiscom-api-client/actions/workflows/static.yml)
[](https://github.com/pashamesh/uiscom-api-client/actions/workflows/code_style.yml)
[
](LICENSE)
[](https://packagist.org/packages/pashamesh/uiscom-api-client)
[](https://packagist.org/packages/pashamesh/uiscom-api-client)
UIS (CoMagic) PHP client for the following APIs:
- [Call API](https://www.uiscom.ru/academiya/spravochnyj-centr/dokumentatsiya-api/call_api/)
- [Data API](https://www.uiscom.ru/academiya/spravochnyj-centr/dokumentatsiya-api/data_api/)
## Requirements
This package requires PHP 7.4 or above.
## Installation
To get started, install package via the Composer package manager:
`composer require pashamesh/uiscom-api-client`
## Usage
### Configuring
Array is using to configure Rest API and Call API clients.
```php
$config = [
// required for Rest API and optional for Call API
'login' => 'put_login_here',
'password' => 'put_password_here',
// required for Call API if login and password not specified
'access_token' => 'put_access_token_here',
];
```
You also need to change domain if you client of Uiscom by specifying `endpoint`:
```php
use Uiscom\CallApiConfig;
$config = new CallApiConfig('login', 'password', 'access_token')
```
Do not forget to add `Call API` permissions to user if you want to use login and
password authorization for Call API.
### Call API
API Methods names need to be specified in CamelCase
```php
use Uiscom\CallApiConfig;
use Uiscom\CallApiClient;
$config = new CallApiConfig('login', 'password', 'access_token');
$callApi = new CallApiClient($config);
var_dump($callApi->listCalls());
```
It's possible to get response metadata after API request is made
```php
var_dump($callApi->metadata());
```
### Data API
API Methods names need to be specified in CamelCase
```php
use Uiscom\DataApiConfig;
use Uiscom\DataApiClient;
$config = new DataApiConfig('access_token');
$dataApi = new DataApiClient($config);
var_dump(
$dataApi->getCallsReport([
'date_from' => '2025-01-10 00:00:00',
'date_till' => '2025-01-13 23:59:59'
])
);
```
It's possible to get response metadata after API request is made
```php
var_dump($dataApi->metadata());
```