PHP code example of pashamesh / comagic-api

1. Go to this page and download the library: Download pashamesh/comagic-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pashamesh / comagic-api example snippets


$config = [
    // t_login_here',
    'password' => 'put_password_here',
    // 

use Uiscom\CallApiConfig;

$config = new CallApiConfig('login', 'password', 'access_token')

use Uiscom\CallApiConfig;
use Uiscom\CallApiClient;

$config = new CallApiConfig('login', 'password', 'access_token');
$callApi = new CallApiClient($config);
var_dump($callApi->listCalls());

var_dump($callApi->metadata());

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

var_dump($dataApi->metadata());