API to search available tracking numbers
Use the Number Search API to search available tracking numbers
Use the Number Search API to search available tracking numbers within DialogTech's available inventory.
Base URL for Number Search
Parameter List
Parameter | Required | Accepts | Max Length | Notes | Usage |
---|---|---|---|---|---|
action | Yes | String: numbers.search | n/a | Only accepts numbers.search to search numbers | Defines the API Call as "Number Search" type |
access_key | Yes | String | n/a | Access Key from the Key Manager within a DialogTech account | Credentials used for access to the API for a particular DialogTech account |
secret_access_key | Yes | String | n/a | Secret Access Key from the Key Manager within a DialogTech account | Credentials used for access to the API for a particular DialogTech account |
type | Yes | String: local or tollfree | n/a | local - Search for a local number tollfree - Search for a toll free number | Defines the type of number being searched for |
value | No* | area code, or area code + exchange | 6 | If searching by area code it must be 3 digits and for NpaNxx it must be 6 digits. Toll free numbers are not supported. | Defines the pattern being searched for within inventory |
quantity | No | String | Range 0-50 | Default: 10 | Amount of phone numbers to return if available |
sms_supported | No | 0 or 1 | 1 | 0 - return any phone numbers matching search criteria, regardless of SMS support (default) 1 - return only phone numbers that can be enabled for SMS | Used to limit the phone number(s) returned to only those that support SMS. Note that phone numbers must still be explicitly registered to receive SMS messages using the SMS APIs. |
*Required when type=local
Using this API
These code examples are meant to show a basic method of accessing DialogTech's IVR Report API.
<?php
/*
Search Number EX:
This example will search DialogTech's
inventory for a local number matching
the area code of 555.
*/
// Create cURL resource
$ch = curl_init();
$baseuri = "https://secure.dialogtech.com/ibp_api.php?";
// API Specific Static Parameters
$action = "numbers.search";
// Required User Parameters To Request the API
$access_key = "foo";
$secret_access_key = "bar";
$type = "local";
$value = "555";
// Non required parameters used to request toe API
$quantity = "3";
// Construct the full URL
$full_url = $baseuri . "&action=" . $action .
"&access_key=" . $access_key .
"&secret_access_key=" . $secret_access_key .
"&type=" . $type .
"&value=" . $value .
"&quantity=" . $quantity;
// Set the URL
curl_setopt($ch, CURLOPT_URL, $full_url);
// Sets the return options of the cURL to return the actual result from the curl request, and FALSE on failure
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// Sets the $output variable to the result of the curl
$output = curl_exec($ch);
// Close curl resource to free up system resources
curl_close($ch);
// Echo the XML response to the page
echo $output;
?>
curl -X ""
Example Response
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE response [
<!ELEMENT response (result,result_description)>
<!ELEMENT result (#PCDATA)>
<!ELEMENT result_description (#PCDATA)>
]>
<response>
<result>success</result>
<result_description>
<quantity>3</quantity>
<numbers>
<number>
<tenDigit>5556666666</tenDigit>
</number>
<number>
<tenDigit>5557777777</tenDigit>
</number>
<number>
<tenDigit>5558888888</tenDigit>
</number>
</numbers>
</result_description>
</response>