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
SMS provisioning could take up to 15 minutes. Please wait at least 15 minutes before using the number or assigning to a campaign.
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
curl -v -X GET "https://apiv1.teleapi.net/dids/order?token=XXXX&number=3035551212&call_flow=33"
Using PHP+CURL
<?php
$data = array("number" => "3035551212",
"call_flow" => "133"
);
$data = http_build_query($data);
$baseurl = "https://apiv1.teleapi.net/dids/order?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("number" => "3035551212",
"call_flow" => "133"
);
$data = http_build_query($data);
$url = "https://apiv1.teleapi.net/dids/order?token=XXXX&".$data;
$x = file_get_contents($url);
$object = json_decode($x);
print_r($object);

Order Phone Number Response Code

Accepted Order

{
"code":200,
"status":"success",
"data"
{"id":"1137811",
"user_id":"320",
"call_flow_id":"287",
"channel_group_id":null,
"voicemail_inbox_id":null,
"number":"7247482695",
"country_code":"1",
"npa":"724",
"nxx":"748",
"xxxx":"2695",
"number_type":"local",
"state":"PA",
"ratecenter":"BLACKTOWN",
"sms_enabled":"1",
"cnam":"disabled"
}
}

Failed Order

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