Overview
Telecom Lookup Tools

Cart - Add Numbers

This allows you to have a single shopping cart, where you add all of your phone numbers to a single order, and then close out the cart.

Get / Post Information

URL:

https://apiv1.teleapi.net/dids/cart?token=XXXXX

Argument

Required

Type

Example

did_number

yes

int

3035551212

fax

no

string

true

vanity_tf

no

string

yes

Info: Pass in the id of the number you want and it will add it to your shopping cart. Optionally, you can mark it as a fax number by passing in fax=true. To order a vanity tollfree number, supply the field vanity_tf=yes, otherwise it will assume that it is not a vanity tollfree number.

shell
PHP+CURL
PHP+PLAIN
RESPONSE
shell

Shell/CURL

curl -v -X GET "https://apiv1.teleapi.net/dids/cart?token=XXXX&did_number=3035551212"
PHP+CURL

Using PHP+CURL

<?php
$data = array("did_number" => "3035551212"
);
$data = http_build_query($data);
$baseurl = "https://apiv1.teleapi.net/dids/cart?token=XXXX&".$data;
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$retval = curl_exec($ch);
curl_close($ch);
$object = json_decode($retval);
print_r($object);
PHP+PLAIN

PHP - file_get_contents

<?php
$data = array("did_number" => "3035551212"
);
$data = http_build_query($data);
$url = "https://apiv1.teleapi.net/dids/cart?token=XXXX&".$data;
$x = file_get_contents($url);
$object = json_decode($x);
print_r($object);
RESPONSE

Successful Addition to Cart

{
"code":200,
"status":"success",
"data":"successfully added item to cart"
}

Failed Adding (Number not Available)

{
"code": 400,
"status": "error",
"data": "invalid did id"
}