PHP code example of tomcan / combell-api

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

    

tomcan / combell-api example snippets




$key = 'YOUR-API-KEY';  
$sec = 'YOUR-API-SECRET';

$api = new \TomCan\CombellApi\Common\Api(
    new \TomCan\CombellApi\Adapter\GuzzleAdapter(),
    new \TomCan\CombellApi\Common\HmacGenerator($key, $sec)
);
$cmd = new \TomCan\CombellApi\Command\Accounts\ListAccounts();
  
var_dump($api->executeCommand($cmd));  

// return the HTTP status code. 200 -> 204 indicate success, other codes typically mean failure of some sort
$api->getStatusCode();

// rate limiting headers
$api->getRateLimitUsage();
$api->getRateLimitRemaining();
$api->getRateLimitReset();
$api->getRateLimitLimit();

$cmd->getPagingSkipped();
$cmd->getPagingTake();
$cmd->getPagingTotalResults();