List Local Numbers
This function will allow you to list all phone numbers in a specific ratecenter and state.
URL:
Argument | Required | Type | Default |
state | no | string | --- |
ratecenter | no | string | --- |
npa | no | int | --- |
nxx | no | int | --- |
search | no | int | --- |
limit | no | int | 5000 |
offset | no | int | 0 |
area_match | no | int | 0 |
Simply send us a GET/POST to the above URL to get an API response with the list of numbers. Response codes are in the menu to the left. You can also search by area code (npa) instead of ratecenter and state.
The area_match parameter allows you to get both "match":"exact" and "match":"related" results. By default, the results will include only exact matching results for the requested search.
shell
PHP+CURL
PHP+PLAIN
RESPONSE
Shell/CURL
curl -v -X GET "https://apiv1.teleapi.net/dids/list?token=XXXX&state=CA&ratecenter=LSAN%20DA01"
Using PHP+CURL
<?php
$data = array("state" => "CA",
"ratecenter" => "LSAN DA01"
);
$data = http_build_query($data);
$baseurl = "https://apiv1.teleapi.net/dids/states?token=XXXX&state=CA";
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$retval = curl_exec($ch);
curl_close($ch);
$object = json_decode($retval);
print_r($object);
PHP - file_get_contents
<?php
$data = array("state" => "CA",
"ratecenter" => "LSAN DA01"
);
$data = http_build_query($data);
$url = "https://apiv1.teleapi.net/dids/states?token=XXXX&".$data;
$x = file_get_contents($url);
$object = json_decode($x);
print_r($object);
{
"code": 200,
"status": "success",
"data": {
"dids": [
{
"id": 222,
"npa": 555,
"nxx": 555,
"xxxx": 5555,
"number": 5555555555,
"ratecenter": "BLARG",
"state": "CO",
"setup_rate":"0.000000",
"monthly_rate":"0.790000",
"per_minute_rate":"0.006000",
"match":"exact"
},
{
"id": 333,
"npa": 555,
"nxx": 555,
"xxxx": 5554,
"number": 5555555554,
"ratecenter": "BLARG",
"state": "CO",
"setup_rate":"0.000000",
"monthly_rate":"0.790000",
"per_minute_rate":"0.006000",
"match":"related"
}
]}
"count": 2
}
{
"code": 400,
"status": "error",
"data": "Missing variable: token"
}