PHP code example of xsme / php-api-adescom

1. Go to this page and download the library: Download xsme/php-api-adescom 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/ */

    

xsme / php-api-adescom example snippets


use xsme\Adescom\AdecomApi;

$api = new AdecomApi();

// Frontend configuration
$api->setFrontend($wsdl, $location, $login, $password);

// Platform configuration
$api->setPlatform($wsdl, $location, $login, $password);

// Userpanel configuration
$api->setUserpanel($wsdl, $location, $login, $password);

$version = $api->getVersion();

$clids = $api->getClids();

$clid = $api->getClid('123456789');

$status = $api->getClidStatus('123456789');

$statuses = $api->getClidsStatus(['123456789', '987654321']);

// Delete with default grace period
$result = $api->deleteClid('123456789');

// Delete with specific grace period
$dateTime = new DateTime('2025-12-31 23:59:59');
$result = $api->deleteClid('123456789', $dateTime);

$pools = $api->getPools();

$numberPools = $api->getNumberPools();

$pool = $api->getNumberPool(1);

$freeNumbers = $api->getFreeNumbersFromPool(1);

$firstFree = $api->getFirstFreeNumberFromPool(1);

$phones = $api->getPhones();

$phone = $api->getPhone(1);

$clients = $api->getClients();

$client = $api->getClient(1);

$client = $api->getClientByExternalId('EXT123');

$clids = $api->getClidsForClient(1);

$clids = $api->getClidsForClientByExternalId('EXT123');

$fromDate = new DateTime('2025-01-01 00:00:00');
$toDate = new DateTime('2025-01-31 23:59:59');
$billing = $api->getBillingByCallerID($fromDate, $toDate, '123456789', true, 1, 1);

$fromDate = new DateTime('2025-01-01 00:00:00');
$toDate = new DateTime('2025-01-31 23:59:59');
$summary = $api->getBillingSummaryByCallerID($fromDate, $toDate, '123456789', true, 1, 1);



sme\Adescom\AdecomApi;
use DateTime;

$api = new AdecomApi();

// Connection configuration
$api->setFrontend('https://example.com/frontend.wsdl', 'https://example.com/frontend', 'login', 'password');
$api->setPlatform('https://example.com/platform.wsdl', 'https://example.com/platform', 'login', 'password');

// Get system version
$version = $api->getVersion();
echo "System version: " . $version . "\n";

// Get list of numbers
$clids = $api->getClids();
print_r($clids);

// Get billing for a number
$fromDate = new DateTime('2025-01-01');
$toDate = new DateTime('2025-01-31');
$billing = $api->getBillingByCallerID($fromDate, $toDate, '123456789');
print_r($billing);
bash
composer