Overview
Telecom Lookup Tools
List Tollfree Numbers
This function will allow you to list all available toll free numbers.

Post/ Get Information

URL:
Argument
Required
Type
Field
type
yes
string
tollfree
Simply send us a GET/POST to the above URL to get an API response with the list of numbers, just pass type=tollfree. Response codes are in the menu to the left.
shell
PHP+CURL
PHP+PLAIN
RESPONSE
Shell/CURL
1
curl -v -X GET "https://apiv1.teleapi.net/dids/list?token=XXXX&type=tollfree"
Copied!
Using PHP+CURL
1
<?php
2
​
3
$data = array("type" => "tollfree");
4
​
5
$data = http_build_query($data);
6
​
7
$baseurl = "https://apiv1.teleapi.net/dids/states?token=XXXX&state=CA";
8
curl_setopt($ch, CURLOPT_POST, 1);
9
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
10
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
11
$retval = curl_exec($ch);
12
curl_close($ch);
13
​
14
$object = json_decode($retval);
15
print_r($object);
Copied!
PHP - file_get_contents
1
<?php
2
$data = array("state" => "CA",
3
"ratecenter" => "LSAN DA01"
4
);
5
​
6
$data = http_build_query($data);
7
​
8
$url = "https://apiv1.teleapi.net/dids/states?token=XXXX&".$data;
9
$x = file_get_contents($url);
10
$object = json_decode($x);
11
print_r($object);
Copied!

Possible System Responses from List Numbers

Successful Number Listing

1
{
2
"code": 200,
3
"status": "success",
4
"data": {
5
"dids": [
6
{
7
"id": 222,
8
"npa": 888,
9
"nxx": 555,
10
"xxxx": 5555,
11
"number": 8885555555,
12
"ratecenter": "tollfree",
13
"state": "null",
14
"setup_rate":"0.000000",
15
"monthly_rate":"0.790000",
16
"per_minute_rate":"0.02000"
17
},
18
{
19
"id": 333,
20
"npa": 888,
21
"nxx": 555,
22
"xxxx": 5554,
23
"number": 8885555554,
24
"ratecenter": "tollfree",
25
"state": "null",
26
"setup_rate":"0.000000",
27
"monthly_rate":"0.790000",
28
"per_minute_rate":"0.0200"
29
}
30
]}
31
"count": 2
32
}
Copied!

Sample Error

1
{
2
"code": 400,
3
"status": "error",
4
"data": "Missing variable: token"
5
}
Copied!
Last modified 1yr ago
Copy link