All API resources
Interconnects
Buying a route from Market View creates an interconnect between one of your accounts and the seller's route. Traffic sent with the route's tech prefix then terminates on it, billed per minute or per message from the account's balance. Purchasing is free; you pay only for traffic.
Buy a route (create an interconnect)
POST/buyers/interconnect
Buys a seller's route for one of your accounts, or for all of them, so you can send it traffic. Returns the tech prefix to put in front of the dialled number (voice) or to use for the route (SMS), the route type, and a link to a rate deck. Buying is free; you pay only for the traffic you send. The account must match the route: a voice account for a voice route, an SMPP account for an SMS route.
route_type is sms for SMS routes and voice otherwise. Anonymous routes show the seller as Anonymous. To get the route's rate deck, call Download a route's rate deck with the route's i_tariff rather than following rates_url. If i_account is not one of your accounts of the route's type, the response is not JSON: check the account before buying.Parameters
addintegerform fieldRequiredMust be 1 to perform the purchase.
idintegerform fieldRequiredThe route's
i_connection, from Market View or List seller routes.i_accountintegerform fieldRequiredThe buyer account to attach the route to. 0 attaches it to every one of your accounts of the matching type that does not already have it.
agreestringform fieldRequiredMust be yes, confirming you accept the seller's terms and conditions.
Errors
| Message | When |
|---|---|
"This API expects parameter add=1 for route purchase" | add is missing or 0 |
"Error! You have to agree to seller terms and conditions to purchase the route (agree=yes)." | agree is not exactly yes |
"Error! Choose another account or route, this route is already purchased for this account." | the account already has this route |
"Error! Seller has blocked one of your accounts on this route, you can not purchase it until it gets unblocked." | the seller has blocked any of your accounts on this route |
"Error! Private route." | the route is private and the seller has not opened it to you |
curl --digest -u "$TCXC_USERNAME:$TCXC_API_KEY" -X POST \
"https://apiv2.telecomsxchange.com/buyers/interconnect" \
-d add=1 \
-d id=38 \
-d i_account=1022 \
-d agree=yesimport os
import requests
from requests.auth import HTTPDigestAuth
resp = requests.post(
"https://apiv2.telecomsxchange.com/buyers/interconnect",
auth=HTTPDigestAuth(os.environ["TCXC_USERNAME"], os.environ["TCXC_API_KEY"]),
data={"add": 1, "id": 38, "i_account": 1022, "agree": "yes"},
)
print(resp.json())$ch = curl_init("https://apiv2.telecomsxchange.com/buyers/interconnect");
curl_setopt_array($ch, [
CURLOPT_HTTPAUTH => CURLAUTH_DIGEST,
CURLOPT_USERPWD => getenv('TCXC_USERNAME') . ':' . getenv('TCXC_API_KEY'),
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => http_build_query(['add' => 1, 'id' => 38, 'i_account' => 1022, 'agree' => "yes"]),
CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);{
"status": "success",
"message": "Interconnection with NorthStarTel completed",
"rates_url": "https://members.telecomsxchange.com/accounts.php?download=38",
"tech_prefix": "33270#",
"route_type": "voice"
}List interconnects
POST/interconnections/list
Lists the routes you have bought (your interconnects) across all your accounts, with the seller, route name, tech prefix, i_tariff, and whether you or the seller has blocked it. The same call can first block or unblock one interconnect: pass its i_purchased_route in block or unblock, and the list returned already reflects the change. A blocked interconnect carries none of your traffic. Free.
result, not status, for success. inactive_prs counts all your interconnects blocked by you or by the seller. Anonymous routes show vendor_login Anonymous and have no i_vendor. A block or unblock value that is not one of your interconnects is ignored.Parameters
blockintegerform fieldOptionali_purchased_routeof an interconnect to block.unblockintegerform fieldOptionali_purchased_routeof an interconnect to unblock.qstringform fieldOptionalSearch text matched against route name, account name, tech prefix and seller login (or the word Anonymous for anonymous routes). Up to 100 characters.
pagerintegerform fieldOptionalMaximum number of interconnects to return.
offintegerform fieldOptionalNumber of interconnects to skip, for paging.
curl --digest -u "$TCXC_USERNAME:$TCXC_API_KEY" -X POST \
"https://apiv2.telecomsxchange.com/interconnections/list" \
-d block=3 \
-d pager=50 \
-d off=0import os
import requests
from requests.auth import HTTPDigestAuth
resp = requests.post(
"https://apiv2.telecomsxchange.com/interconnections/list",
auth=HTTPDigestAuth(os.environ["TCXC_USERNAME"], os.environ["TCXC_API_KEY"]),
data={"block": "3", "pager": 50, "off": 0},
)
print(resp.json())$ch = curl_init("https://apiv2.telecomsxchange.com/interconnections/list");
curl_setopt_array($ch, [
CURLOPT_HTTPAUTH => CURLAUTH_DIGEST,
CURLOPT_USERPWD => getenv('TCXC_USERNAME') . ':' . getenv('TCXC_API_KEY'),
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => http_build_query(['block' => "3", 'pager' => 50, 'off' => 0]),
CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);{
"result": "success",
"purchased_routes": [
{
"i_purchased_route": "4",
"vendor_login": "NorthStarTel",
"connection_name": "Gold+",
"i_tariff": "3",
"tech_prefix": "36310#",
"blocked": "0",
"vendor_blocked": "0",
"account_name": "Northwind",
"i_vendor": "2",
"smpp": "1",
"anonymous": "0"
},
{
"i_purchased_route": "9",
"vendor_login": "Anonymous",
"connection_name": "Premium CLI",
"i_tariff": "41",
"tech_prefix": "41822#",
"blocked": "1",
"vendor_blocked": "0",
"account_name": "Northwind",
"smpp": "0",
"anonymous": "1"
}
],
"inactive_prs": 1
}