Overview
Telecom Lookup Tools
Powered By GitBook
List States
This function will allow you to list all states available for ordering numbers.

Post/ Get Information

URL:
Simply send us a GET to the above URL to get an API response with the list of states. 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/states?token=XXXX"
Copied!
Using PHP+CURL
1
<?php
2
โ€‹
3
$baseurl = "https://apiv1.teleapi.net/dids/states?token=XXXX";
4
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
5
$retval = curl_exec($ch);
6
curl_close($ch);
7
โ€‹
8
$object = json_decode($retval);
9
print_r($object);
Copied!
PHP - file_get_contents
1
<?php
2
$url = "https://apiv1.teleapi.net/dids/states?token=XXXX";
3
$x = file_get_contents($url);
4
$object = json_decode($x);
5
print_r($object);
Copied!

Successful State Listing

1
{
2
"code": 200,
3
"status": "success",
4
"data": {
5
"AB":"Alberta",
6
"AK":"Alaska",
7
"AL":"Alabama",
8
"AR":"Arkansas",
9
"AZ":"Arizona",
10
...
11
}
12
}
Copied!

Example Error

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