Visit our new API Documentation portal.

The TelecomsXChange Voice API is the easiest way to build high-quality voice applications in the Cloud. With the Voice API you:

  • Build apps that scale with the web technologies that you are already using
  • Control the flow of outbound calls in JSON 
  • Empower your web applications and web forms with Voice Communications capabilities
  • Connect Number A with Number B quickly
  • Choose Termination Carrier for Both Calls 
  • Set Caller ID for both calls on the fly
  • Greet your customers when they signup on your website via a real phone call to their number
  • Lowest Programmable Voice Calling Rates guaranteed


To get started please signup here .


Code


PHP Code Sample:


<?php

$tcxc_host = "https://members.telecomsxchange.com";

//TCXC (TelecomsXChange) Buyer login
$login = "{{ Buyer_Username }}";

//TCXC (TelecomsXChange) API key, Generated from Buyer Portal, Preferences Page:

$api_key = "{{ API_KEY }}";

//TCXC i_account that you want to use for Callback billing, 


$i_account = 1;  // You can get account ID from Accounts Page


//legA parameters

$cld1 = "19542405555";  //First number to dial
$cli1 = "1800999999";  // Caller ID to show first number
$i_connection1 = 315;  // Carrier to use e.g 315 is TATA Communications

//legB parameters
$cld2 = "18667478647"; //Second number to dial
$cli2 = "962790326274"; //Caller ID t show destination number
$i_connection2 = 529;  // Carrier to use e.g 529 is IBASIS

$ts = time();   // Get Current Time Stamp

$check_uri = "/api/callback/initiate/$login/$i_account/$cld1/$cli1/$i_connection1/$cld2/$cli2/$i_connection2/$ts/";

// Signing the API key for better security

$sign = hash('sha256',$check_uri . $api_key);

// initiate the call from your script

$handle=curl_init( $tcxc_host . $check_uri . $sign );

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;



Response:


{
status: "ok",
status_text: "Callback has been initiated"
}



Python Code Sample:


import pycurl
import time
import hashlib
from StringIO import StringIO

tcxc_host = "https://members.telecomsxchange.com";

# TCXC login
login = "Enter_Buyer_Username";

#TCXC API key generated from TelecomsXChange members portal:
api_key = "Your API KEY";

#TCXC i_account that you want to use for call billing
i_account = "0001";

#legA parameters
cld1 = "380913105503";
cli1 = "123123123123";
i_connection1 = "220";

#legB parameters
cld2 = "18667478647";
cli2 = "345345345";
i_connection2 = "220";

ts = int(time.time())

check_uri = "/api/callback/initiate/%s/%s/%s/%s/%s/%s/%s/%s/%d/" % (login, i_account, cld1, cli1, i_connection1, cld2, cli2, i_connection2, ts);

sign = hashlib.sha256("%s%s" % (check_uri, api_key));

call_url = "%s%s%s" % (tcxc_host, check_uri, sign.hexdigest() )

#print call_url

curl = pycurl.Curl()
curl.setopt(pycurl.URL, call_url )
curl.setopt(pycurl.HTTPGET, 1)
curl.setopt(pycurl.SSL_VERIFYPEER, 0)
curl.setopt(pycurl.SSL_VERIFYHOST, 0)
buff = StringIO()
curl.setopt(pycurl.WRITEFUNCTION, buff.write)
curl.perform()
print buff.getvalue()



Video Tutorial: