Prior to development we just login as a seller and go to live calls.

Select to search for prefix 9 and press search.

Now let us do the same request result via API so we take a URL (L in the end) from browser:

In this example current request uri is as follows, let us call it "original request uri": 


Now to create an API call similar to web result we have to perform the following steps:

1) add parameter api=1 to the end of request uri, so it becomes:


2) add parameter ts=<CURRENT_UNIX_TIMESTAMP> to the end of request uri, so in current example it would be:


3) add seller(buyer) login and login_type, and let us call this uri 'final API uri' 


4) In this step we will have to add a security signature, that verifies seller/buyer permission to perform the API call.

For this purpose we concatenate 'final API uri' and seller API signature. The difference between previous steps is that we just add the string, without creating valid HTTP parameter for it, the resulting string we call 'secret string':


next we have to calculate SHA256 hash of the 'secret string'. In our example it would be as follows and we would call"signature hash"

") = "8d7740703b1d00861ae0b664842ae910a88c9ac35c98a61a025172a7e702dba5"

5) The final step is to add 'signature hash' from step 4) using sign parameter to 'final API uri' and add a host part to it:$filters=$prefix&amp;show=all&amp;api=1&amp;ts=1433535761&amp;login=$USERNAME&amp;login_type=$TYPE&amp;sign=$token";

6) To call this URL via PHP Script using CURL, see below example


// Set some URL options in PHP Variables to make it more readable 

$USERNAME = "SELLERUSERNAME";  // Your TelecomsXChange Seller/Buyer User ID
$token = "b28c5ab8181b05455d16c10e1b5f028e6a8348828470084b5ccfd1c2a5a346e9"; // Final Signature
$prefix = "1954"; // Country Code Filter (opeional
$filters = "like=is+like&amp;prefix"; // Search Filters

// Store final URL in a PHP variable. 

$get_tcxc_live_calls = "$filters=$prefix&amp;show=all&amp;api=1&amp;ts=1433535761&amp;login=$USERNAME&amp;login_type=$TYPE&amp;sign=$token";

curl_setopt($handle, CURLOPT_VERBOSE, true);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);

$content = curl_exec($handle);

echo $content;

The above URL may be used by a script to fetch the result.

API results:


Successful API results will be provided as 'text/csv' Content-Type. API results and format will be same exactly as if you pressed "download results" when you were logged in through non-API interface.

Failed API calls will result into 'text/html' Content-Type and result will contain explanation string