Order Single Number

This function will allow you to order a specific number.

Post/ Get Information

URL:

https://apiv1.teleapi.net/dids/order?token=XXXXXXX

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

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

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/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"
}

results matching ""

    No results matching ""