Overview
Telecom Lookup Tools
Powered By GitBook
Order Single Number
This function will allow you to order a specific number.

Post/ Get Information

URL:
Argument
Required
Type
Value Example
number
yes
string
3035551212
call_flow
no
int
126
fax
no
int
yes
channel_group
no
int
126
voicemail_inbox_id
no
int
155
cnam
no
string
enabled
sms_post_url
no
string
http://example.net
call_post_url
no
string
https://example.net
delivery_notification_url
no
string
https://example.net
call_flow - is the call flow created in the portal you create to tell the number how to route
fax - if set to yes, the number will be a fax number
channel_group - if you have a virtual PRI or channel group, pass the id number
voicemail_inbox_id - if you have a voicemail you want this number to default to, pass it here
cnam - if you want caller id name to be passed (extra charge) enable this here
sms_post_url - Set an SMS URL specific to a phone number. This will override the account-wide SMS URL
call_post_url - The HTTP/HTTPS URL to call to
delivery_notification_url - Set the DLR notification URL for a phone number
​
Simply send us a GET/POST to the above URL to get an API response with the specific number. 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/order?token=XXXX&number=3035551212&call_flow=33"
Copied!
Using PHP+CURL
1
<?php
2
​
3
$data = array("number" => "3035551212",
4
"call_flow" => "133"
5
);
6
​
7
$data = http_build_query($data);
8
​
9
$baseurl = "https://apiv1.teleapi.net/dids/order?token=XXXX&state=CA";
10
curl_setopt($ch, CURLOPT_POST, 1);
11
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
12
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
13
$retval = curl_exec($ch);
14
curl_close($ch);
15
​
16
$object = json_decode($retval);
17
print_r($object);
Copied!
PHP - file_get_contents
1
<?php
2
$data = array("number" => "3035551212",
3
"call_flow" => "133"
4
);
5
​
6
$data = http_build_query($data);
7
​
8
$url = "https://apiv1.teleapi.net/dids/order?token=XXXX&".$data;
9
$x = file_get_contents($url);
10
$object = json_decode($x);
11
print_r($object);
Copied!

Order Phone Number Response Code

Accepted Order

1
{
2
"code":200,
3
"status":"success",
4
"data"
5
{"id":"1137811",
6
"user_id":"320",
7
"call_flow_id":"287",
8
"channel_group_id":null,
9
"voicemail_inbox_id":null,
10
"number":"7247482695",
11
"country_code":"1",
12
"npa":"724",
13
"nxx":"748",
14
"xxxx":"2695",
15
"number_type":"local",
16
"state":"PA",
17
"ratecenter":"BLACKTOWN",
18
"sms_enabled":"1",
19
"cnam":"disabled"
20
}
21
}
Copied!

Failed Order

1
{
2
"code": 400,
3
"status": "error",
4
"data":"Invalid did id"
5
}
Copied!
Last modified 11mo ago
Copy link