PHP code example of xtratio / onlinepbx-api

1. Go to this page and download the library: Download xtratio/onlinepbx-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/ */

    

xtratio / onlinepbx-api example snippets




// Create new client object
$api = new xtratio\Onpbx\ApiClient(
            "yourdomain.onpbx.ru",
            "api key"
        );
        
// Get call history
$from = (new DateTime())->modify("-1 day")->format("r");
$to = (new DateTime())->format("r");
$result = $api->callHistory(array("date_from"=>$from,"date_to"=>$to));