Getting Started
The QuestBlue API is a way for you to access and perform critical functions within your own application or website.
To get started, visit our downloads page and grab the SDK for the language you will be using. Downloads
The QuestBlue Difference
- QuestBlue's new REST API provides even more powerful tools with highly optimized functionality, for the best fit to the widest possible range of your needs.
- SSL security technology protects your private data in transmission.
- Two levels of authorization provides a highly secure data exchange with your application.
- Optional JSON or XML data exchange format conveniently allows you to use the format you love to work with.
- Intuitive API interface lets you easily and quickly build your own VoIP services.
Setting up your QuestBlue Account
1. Head over to https://customer.questblue.com/register and complete the registration process
2. Once registration is complete login to your customer dashboard https://customer.questblue.com
3. Navigate to Services->Programmers API
4. Under API access put in the IP of the server you will be making API calls from
Quickstart
Setup your credentials in the Connect class:
<?php
//Located at api_v2->Connect.php lines 18-22
$this->login = 'ACCOUNT_LOGIN'; // Your account username or API username
$this->password = 'ACCOUNT_PASSWORD'; // Your account password or API password
$this->key = 'ACCOUNT_PRIVATE_KEY'; // Your API private key
$this->type = 'json'; // API type, available values: json, xml
$this->my_ip = '256.256.256.256'; // Your server IP address
?>
Note: The IP here MUST be the IP you added to the customer portal
List the available states sample code
<?php
//Require the correct class containing the functions we need
require_once("api_v2/Dids.php");
//Create a new instance of the class
$api = new Dids;
//Call the function to list available states
//and save the response in a variable
$response = $api->listStates();
//Print the results to the screen
print($response);
?>
Download one of our SDK from Downloads
Navigate to the Connect class
In this file find the lines displayed to the right. Update these lines with the relevant info from your portal
You can now test proper setup by making a call to list the available states.(sample code to right)
API History
Release Date | Version | Changelog |
---|---|---|
04/24/2020 | 2.1.3 | 2.1.3 |
04/24/2020 | 2.1.2 | 2.1.2 |
02/10/2020 | 2.1.1 | 2.1.1 |
06/14/2019 | 2.0.0 | unavailable |
API Reference
QuestBlues Rest API gives you access to a full suite of classes and methods that allows you unparralled expandability in whatever applications you seek to make.
Supported Languages and SDK Downloads
Account
<?php
require_once("api_v2/Account.php");
$account = new Account;
?>
private APICredential _apiCredential = new APICredential("username","password","privkey");
private Account _account = new Account(_apiCredential);
The Account
class gives you access to methods that control your account such as getting or setting your account balance
To get started add a new reference to the Account
class
getAccountBalance [GET] [Account]
Get Account Balance Example
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XGET https://api2.questblue.com/account/getbalance
<?php
//Require the neccesary class once
require_once("api_v2/Account.php");
//Create a new instance of the class
$account = new Account;
//Grab the balance and store it for later use
$balance = $account->getAccountBalance();
//Print the balance to the screen
print($balance);
?>
string result = _account.GetAccountBalance();
Console.WriteBalance(result);
Output:
{"data": {"balance":"10.00", "allowed_credit":"10.00"} }
If available, get account balance and allowed credit
Request Method and URL: GET https://api2.questblue.com/account/getbalance
Params to Send: none
Response:
JSON | XML | |||
---|---|---|---|---|
Success: {"data": {"balance":"99.00", "allowed_credit":"110.00"} } (HTTP Code: 200) | Success: <response><data><balance>99.00</balance><allowed_credit>110.00</allowed_credit></data></response> (HTTP Code: 200) |
|||
setAutorefill [PUT] [Account]
Enable autorefill example
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPUT https://api2.questblue.com/account/setautorefill -d "{\"autorefill\":\"on\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Account.php");
//Create a new instance of the class
$account = new Account;
//Turn autorefill on and store the response
$response = $account->setAutorefill("on");
//Check if the response has errors
if(!empty($response)){
//If the response is not empty print errors
print($response);
}
?>
_account.setautorefill(true);
_account.setautorefill(false);
Enable or disable automatic account autorefill
Request Method and URL: PUT https://api2.questblue.com/account/setautorefill
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
autorefill | Enable or disable | Required | (string)"on"/"off" |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
Error: {"error":"Error Message"} | Error: <response><error>Error Message</error></response> |
setBalanceReload [PUT] [Account]
Set minimum balance to $5 and reload amount to $50 example
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPUT https://api2.questblue.com/account/setbalancereload -d "{\"min_balance\":5,\"reload_amount\":50}"
<?php
//Require the neccesary class once
require_once("api_v2/Account.php");
//Create a new instance of the class
$account = new Account;
//Set minimum balance to $5 and reload amount to $50 and store response
$response = $account->setBalanceReload(5,50);
//Check if the response has errors
if(!empty($response)){
//If the response is not empty print errors
print($response);
}
?>
string result = _account.SetBalanceReload("5", "50");
Console.WriteLine(result);
}
Configure minimum account balance and autorefill values
Request Method and URL: PUT https://api2.questblue.com/account/setbalancereload
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
min_balance | Minimum account balance. | Required | (int)5, 25, 30, 35, 40, 45, 50, 100 |
reload_amount | Autorefill balance amount. | Required | (int)25, 50, 60, 70, 80, 90, 100, 200, 300, 400, 500, 1000, 15000, 2000, 2500 |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
Error: {"error":"Error Message"} | Error: <response><error>Error Message</error></response> |
refillBalance [PUT] [Account]
Load $16 to account
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPUT https://api2.questblue.com/account/refillbalance -d "{\"amount\":16}"
<?php
//Require the neccesary class once
require_once("api_v2/Account.php");
//Create a new instance of the class
$account = new Account;
//Load $16 to account and store response
$response = $account->refillBalance(16);
//Check if the response has errors
if(!empty($response)){
//If the response is not empty print errors
print($response);
}
?>
string result = _account.RefillBalance("10");
Console.WriteLine(result);
Refill account balance
Request Method and URL: PUT https://api2.questblue.com/account/refillbalance
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
amount | Amount to refill balance. | Required | (int)Minimum value 10(USD) |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
Error: {"error":"Error Message"} | Error: <response><error>Error Message</error></response> |
getRates [GET] [Account]
Get Rates Example
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XGET https://api2.questblue.com/account/rates
<?php
//Require the neccesary class once
require_once("api_v2/Account.php");
//Create a new instance of the class
$account = new Account;
//Get rates and store the response
$rates = $account->getRates();
//Display the rates on the page
print($rates);
?>
string result = _account.GetRates();
Console.WriteLine(result);
Output: {"data":{"local_did_cost":"0.00","inbound_call_rate":"0.0000","outbound_local_call_rate":"0.0000", "outbound_information":"0.00","toll_free_did_cost":"0.00","toll_free_call_rate":"0.0000","cnam_rate":"0.00", "e911_rate":"0.00","e911_tier2_rate":"3.50","e911_offnet_rate":"0.00","international_did_cost":"0.00", "international_did_direct_dial_cost":"0.00","fax_did_cost":"0.00","fax_minute_rate":"0.000","lnp_cost":"0.00", "dedicated_server_rate":"0.00","vps_server_rate":"0.00","ccrf":"0.00"}}
List the service rates
Request Method and URL: GET https://api2.questblue.com/account/rates
Params to Send: none
Response:
JSON | XML |
---|---|
Success: {"data": { "local_did_cost":"1.00", "inbound_call_rate":"0.01", "vps_server_rate":"24.00", "ccrf":"18.80" }} | Success: <response> <data> <local_did_cost>1.00</local_did_cost> <inbound_call_rate>0.01</inbound_call_rate> <vps_server_rate>24.00</vps_server_rate> <ccrf>18.80</ccrf> </data> </response> |
Error: {"error":"Error Message"} | Error: <response> <error>Error Message</error> </response> |
countryList [GET] [Account]
Display available countries example
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XGET https://api2.questblue.com/account/countrylist
<?php
//Require the neccesary class once
require_once("api_v2/Account.php");
//Create a new instance of the class
$account = new Account;
//Get country list and store the response
$country_list = $account->countryList();
//Display the country list on the page
print($country_list);
?>
string result = _account.CountryList();
Console.WriteLine(result);
Output: {"data":[{"country_id":2689,"country_name":"AFGHANISTAN"}.................{"country_id":2919,"country_name":"ZIMBABWE"}]}
List available countries list for international calls
Request Method and URL: GET https://api2.questblue.com/account/countrylist
Params to Send: none
Response:
JSON | XML |
---|---|
Success: {"data" [ { "country_id":2689, "country_name":"AFGHANISTAN" }, …. { "country_id":2919, "country_name":"ZIMBABWE" } ]} | Success: <response><data><row0><country_id>2689</country_id><country_name>AFGHANISTAN</country_name></row0><row230><country_id>2919</country_id><country_name>ZIMBABWE</country_name></row230></data></response> |
Error: {"error":"Error Message"} | Error: <response><error>Error Message</error></response> |
countryRate [GET] [Account]
Display Country Rates Example
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XGET https://api2.questblue.com/account/countryrate -d "{\"country_id\":2725}"
<?php
//Require the neccesary class once
require_once("api_v2/Account.php");
//Create a new instance of the class
$account = new Account;
//Get country rates and store the response
$rates = $account->countryRate(2725); //2725 = CANADA HIGH COST AREA
//Display the rates on the page
print($rates);
?>
string result = _account.CountryRate("2865"); //2865 is the country id for SAUDI ARABIAs
Console.WriteLine(result);
Output: {"data":[{"destination":"CANADA HIGH COST AREA","code":"1519225","rate":"0.2840"}.................{"destination":"CANADA HIGH COST AREA","code":"1519237","rate":"0.2840"}]}
Lists international call rates by country
Request Method and URL: GET https://api2.questblue.com/account/countryrate
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
country_id | Country ID | Required | (int)Any Numerical Country Code |
Response:
JSON | XML |
---|---|
Success: {"data":[ { "destination":"FRANCE", "code":"33", "rate":"0.2530"}, } } ]} | Success: <response><data><row0><destination>FRANCE</destination><code>33</code><rate>0.2530</rate></row0></data></response> |
Error: {"error":"Error Message"} | Error: <response><error>Error Message</error></response> |
interRatesZone2 [GET] [Account]
Display zone 2 rates example
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XGET https://api2.questblue.com/account/ratezone2
<?php
//Require the neccesary class once
require_once("api_v2/Account.php");
//Create a new instance of the class
$account = new Account;
//Get zone2 rates and store the response
$rates = $account->interRatesZone2();
//Display the rates on the page
print($rates);
?>
string result = _account.InterRatesZone2();
Console.WriteLine(result);
Output: {"data":[{"destination":"American Samoa","code":"1684","rate":"0.1000"}.............{"destination":"USA-834 C (HAWAII)","code":"808","rate":"0.0420"}]}
Lists international call rates for Zone 2
Request Method and URL: GET https://api2.questblue.com/account/ratezone2
Params to Send: none
Response:
JSON | XML |
---|---|
Success: {"data":[ { "destination":"American Samoa", "code":"1684", "rate":"0.1188" } ]} | Success: <response><data><row0><destination>America Samoa</destination><code>1684</code><rate>0.1188</rate></row0></data></response> |
Error: {"error":"Error Message"} | Error: <response><error>Error Message</error></response> |
Dids
<?php
require_once("api_v2/Dids.php");
$dids = new Dids;
?>
private APICredential _apiCredential = new APICredential("username","password","privkey");
private Dids _dids = new Dids(_apiCredential);
The Dids
class gives you access to methods that control dids in your account from ordering,updating,deleting and much more
listStates [GET] [DID]
List States Example
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XGET https://api2.questblue.com/did/states
<?php
//Require the neccesary class once
require_once("api_v2/Dids.php");
//Create a new instance of the class
$dids = new Dids;
//Grab the states list and store it for later use
$states_list = $dids->listStates();
//Print the states list to the screen
print($states_list);
?>
string result = _dids.ListStates();
Console.WriteLine(result);
Output: {"total":60,"data":["AA","AB","AL","AR","AZ","BC","CA","CO", "CT","DC","DE","FL","GA","HI","IA","ID","IL","IN","KS","KY", "LA","MA","MB","MD","ME","MI","MN","MO","MS","MT","NC","ND", "NE","NF","NH","NJ","NM","NV","NY","OH","OK","ON","OR","PA", "PQ","PR","QB","RI","SC","SD","SK","TN","TX","UT","VA","VT", "WA","WI","WV","WY"]}
List of states where at least one Rate Center is available
Request Method and URL: GET https://api2.questblue.com/did/states
Params to Send: none
Response:
JSON | XML |
---|---|
Success: {"total":52, "data":["AA", … "WY"]} | Success: <result><total>52</total><data><row0>AA</row0><row51>WY</row51></data></result> |
listRateCenters [GET] [DID]
List Rate Centers Example
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XGET https://api2.questblue.com/did/ratecenters -d "{\"state\": \"NC\",\"tier\": \"1b\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Dids.php");
//Create a new instance of the class
$dids = new Dids;
$tier = "1b"; //SMS Enabled
$state = "NC";
//Grab the list of rate centers and store it for later use
$rate_centers_list = $dids->listRateCenters($tier,$state);
//Print the states list to the screen
print($rate_centers_list);
?>
string result = _dids.ListRateCenters();
Console.WriteLine(result);
Output: {"total":340,"data":{"ABERDEEN":"ABERDEEN"........."YADKINVL":"YADKINVILLE","YANCEYVL":"YANCEYVILLE","ZEBULON":"ZEBULON"}}
List of rate centers for a state
Request Method and URL: GET https://api2.questblue.com/did/ratecenters
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
state | Two char state name | Required | (string)NC,SC.... |
tier | DID tier level | Required | (string)0(No TF dids available),1/1b(SMS enabled),2(No TF dids available) |
Response:
JSON | XML |
---|---|
Success: {"total":321, "data":{"ACME":"ACME","ZEBULON":"ZEBULON"}} | Success: <result><total>321</total><data><ACME>ACME</ACME><ZEBULON>ZEBULON</ZEBULON></data></result> |
listAvailableDids [GET] [DID]
List available dids with type and tier
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XGET https://api2.questblue.com/did/available -d "{\"type\": \"tf\",\"tier\":\"1b\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Dids.php");
//Create a new instance of the class
$dids = new Dids;
$type = "tf";
$tier = "1b";
//Grab the list and store it for later use
$available_dids = $dids->listAvailableDids($type,$tier);
//Print the list to the screen
print($available_dids);
?>
ListAvailableDidsModel listAvailableDidsModel = new ListAvailableDidsModel(){
type = "tf",
tier = "1b"
};
string result = _dids.ListAvailableDids(listAvailableDidsModel);
Console.WriteLine(result);
Output: {"total":100,"data":["8448779235".............."8448874677","8448874679"]}
Get List of available DIDs - Local or Toll Free
Request Method and URL: GET https://api2.questblue.com/did/available
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
type | DID type to list | Required | (string)local/tf(toll free) TF is not available for Tier 2 |
tier | Required | (string)1/1b(SMS Enabled)/2 | |
state | For local DIDs only | Required for Local DIDs if no NPA is entered | (string)Two char state code North Carolina = NC |
ratecenter | For Local DIDs only. | Required for Local DIDs if no NPA is entered | (string) |
zip | Is used for Local DIDs only. For tier 1b only. If ZIP is set then no NPA, state and rate center is required. The option takes precedence over state/rate center and NPA. | Optional | (int)Five Char |
npa | Is used for Local DIDs only. If NPA is set then no state and rate center is required. The option takes precedence over state/rate center | Optional | (int)Three char |
code | Toll Free code. For TF DIDs only. | Optional | (int)Two char |
Response:
JSON | XML |
---|---|
Success: {"total":321, "data":{"ACME":"ACME","ZEBULON":"ZEBULON"}} | Success: <result><total>321</total><data><ACME>ACME</ACME><ZEBULON>ZEBULON</ZEBULON></data></result> |
orderDid [POST] [DID]
Order t1 did
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPOST https://api2.questblue.com/did -d "{\"tier\": \"1b\",\"did\": 3332224444, \"note\": null}"
<?php
//Require the neccesary class once
require_once("api_v2/Dids.php");
//Create a new instance of the class
$dids = new Dids;
//Grab the response and store it for later use
$response = $dids->orderDid("1b","3332224444");
//Print the response to the screen
print($response);
?>
OrderDidModel didModel = new OrderDidModel(){
tier = "1b",
did = "3332224444"
};
string result = _dids.OrderDid(didModel);
Console.WriteLine(result);
Output: 1
Order Local or Toll Free DID
Request Method and URL: POST https://api2.questblue.com/did
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
tier | Required | (string)0(No TF dids available),1/1b(SMS enabled),2(No TF dids available) | |
did | Did to order | Required | (mixed) Integer or Array |
route2trunk | SIP trunk to route the DID to. The trunk must be active. | Optional | (string) |
cnam | Enable CNAM services | Optional | (string) on/off |
note | DID note | Optional | (string) |
pin | Port out security PIN code | Optional | (int) 4 char(Set empty value to remove) |
lidb | Set the CallerID name for the TN | Optional | (string) 4-15 chars [a-z0-9] |
e911 | See Update DID for parameters | Optional | (array) |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
Warning (Non Critical Error): {"warning":["Warning Message"]} | Warning (Non Critical Error): <resposne><warning><row0>Warning Message</row0></warning></response> |
Error: {"error":"Error Message"} | Error: <response><error>Error Message</error></response> |
listDids [GET] [DID]
Display the 3rd page of numbers with the area code "333"
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XGET https://api2.questblue.com/did -d "{\"did\": \"333*\",\"per_page\": 25, \"page\": 3}"
<?php
//Require the neccesary class once
require_once("api_v2/Dids.php");
//Create a new instance of the class
$dids = new Dids;
//Grab the response and store it for later use
$did_list = $dids->listDids("333*","25","3");
//Print the list to the screen
print($did_list);
?>
string result = _dids.ListDids("333*","25","3");
Console.WriteLine(result);
Output: {"total":21,"data":[{"did":9105050399,"status":"active","tier":"1b","type":"local","note":"QuBeTest", "route2trunk":"Brandontest"}.......{"did":8448859713,"status":"active","tier":"1b","type":"tf"}]}
List Ordered DIDs and thier configurations
Request Method and URL: GET https://api2.questblue.com/did
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
did | DID to retrieve info. Support for Unix style DID searching. | Optional | (string)Minimum 3 char, 123,123*.... |
per_page | Number of records to list in a page. Default value is 25. | Optional | (int)5-200 |
page | Page number to retrieve data from | Optional | (int) |
Response:
JSON | XML |
---|---|
Success: {"total":9, "total_pages":9, "current_page":1, "data":[{ "did":"9192138311", "status":"active", "tier":"1b", "type":"local", "note":"", "route2trunk":"", "lidb":"", "cnam":"", "e911":"", "failover":”” }] } | Success: <response><total>9</total><total_pages>9</total_pages><current_page>1</current_page><data><row0><did>9192138311</did><status>active</status><tier>1b</tier><type>local></type><note>Test e911</note></route2trunk></lidb></cnam></e911></failover></row></data></response> |
updateDid [PUT] [DID]
Update the note on a did
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPUT https://api2.questblue.com/did -d "{\"did\": 3332224444, \"note\": \"New note\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Dids.php");
//Create a new instance of the class
$dids = new Dids;
//Grab the response and store it for later use
$response = $dids->updateDid("3332224444","New note");
//Print the response to the screen
print($response);
?>
UpdateDidModel didModel = new UpdateDidModel(){
did = "3332224444",
note = "New note"
};
string result = _dids.UpdateDid(didModel);
Console.WriteLine(result);
Output: 1
Manage Active DID Configuration and Settings
Request Method and URL: PUT https://api2.questblue.com/did
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
did | DID to manage | Required | (int) |
note | Add a note/comment to the DID | Optional | (string)Up to 15 chars. Set to empty to remove the note |
pin | Port Out Security PIN code | Optional | (int) |
route2trunk | Route the DID to a SIP trunk. The trunk must be active. | Optional | (string)Set to empty to unroute the DID |
forw2did | US based DID to forward inbound calls | Optional | (int) |
failover | Change trunk's IP address on experiencing a specific number of timeout errors(failover_num) within a specific time (failover_time) | Optional | (array) [string]failover_ip_address = new IP address to set on experiencing timeout errors [int]failover_num = range 1 to 100, Number of offline calls received within failover_time required to trigger failover [int]failover_time = Time window(in minutes) that system will check for failover_num calls Possible Values 2,3,5,7,10,15,20,30 |
lidb | Set the CallerID Name for the TN. | Optional | (string)4-15 chars long, [a-z0-9] only |
cnam | Manage CNAM | Optional | (string) yes/no |
e911 | See E911 table below | Optional | (array)See E911 table below |
E911 parameters and values or set e911 value to no(empty) to remove E911
Parameter | Description | Mandatory | Values |
---|---|---|---|
e911_name | Name of the person or business registering for 911 | Required | (string) |
e911_city | City of the registered 911 customer | Required | (string) |
e911_state | State of registered 911 customer | Required | (string) |
e911_zip | Zip code of registered 911 customer | Required | (string) |
e911_address | Address of the registered 911 customer | Required | (string) |
e911_unittype | Type of unit customer lives | Optional, It will be ignored if unit number has not been provided | (string) |
e911_unitnumber | Unit number or letter of customer premise | Optional, It will be ignored if unit type has not been provided | (string) |
JSON | XML |
---|---|
Success: empty | Success: empty |
Warning (Non Critical Error): {"warning":["Warning Message"]} | Warning (Non Critical Error): <response><warning>Warning Message</warning></response> |
Error: {"error":"Error Message"} | Error: <response><error>Error Message</error></response> |
deleteDid [DELETE] [DID]
Order t1 did
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XDELETE https://api2.questblue.com/did -d "{\"did\": 3332224444}"
<?php
//Require the neccesary class once
require_once("api_v2/Dids.php");
//Create a new instance of the class
$dids = new Dids;
//Grab the response and store it for later use
$response = $dids->deleteDid("3332224444");
//Print the response to the screen
print($response);
?>
string result = _dids.DeleteDid("3332224444");
Console.WriteLine(result);
Output: 1
Completely Remove DID from Inventory
Request Method and URL: DELETE https://api2.questblue.com/did
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
did | DID to remove | Required | (int) |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
Error: {"error":"DID Ordering Error"} | Error: <response><error>Error Messsage</error></response> |
move2fax [PUT] [DID]
Move voice DID to Fax Inventory
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPUT https://api2.questblue.com/did/move2fax -d "{\"did\": 3332224444}"
<?php
//Require the neccesary class once
require_once("api_v2/Dids.php");
//Create a new instance of the class
$dids = new Dids;
//Grab the response and store it for later use
$response = $dids->move2fax("3332224444");
//Print the response to the screen
print($response);
?>
Move voice DID to Fax Inventory
Request Method and URL: PUT https://api2.questblue.com/did/move2fax
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
did | DID to move | Required | (int) |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
Error: {"error":"Error message"} | Error: <response><error>Error Messsage</error></response> |
IFaxEnterprise
listStates [GET] [IFAXENTERPRISE]
Display list of states
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XGET https://api2.questblue.com/fax/states
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxenterprise.php");
//Create a new instance of the class
$ifaxenterprise = new Ifaxenterprise;
//Grab the response and store it for later use
$response = $ifaxenterprise->listStates();
//Print the response to the screen
print($response);
?>
Output: {"total":60,"data":["AA","AB","AL","AR"....."UT","VA","VT","WA","WI","WV","WY"]}
List of states(short names) where at least one Rate Center is available
Request Method and URL: GET https://api2.questblue.com/fax/states
Params to Send: none
Response:
JSON | XML |
---|---|
Success: {"total":52, "data":["AA", … "WY"]} | Success: <result><total>52</total><data><row0>AA</row0>...<row51>WY</row51></data></result> |
listRateCenters [GET] [IFAXENTERPRISE]
Display list of ratecenters
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XGET https://api2.questblue.com/ratecenters -d "{\"state\": \"AB\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxenterprise.php");
//Create a new instance of the class
$ifaxenterprise = new Ifaxenterprise;
//Grab the response and store it for later use
$response = $ifaxenterprise->listRateCenters("AB");
//Print the response to the screen
print($response);
?>
Output: {"total":217,"data":["ACADIA VLY","ACME""ROCKYMT HS","ROSEBUD","RUMSEY","RYCROFT"..........."WILLINGDON","WOKING","WRENTHAM","YOUNGSTOWN"]}
List of Rate Centers for a State
Request Method and URL: GET https://api2.questblue.com/ratecenters
Params to Send:
Parameter | Description | Madatory | Values |
---|---|---|---|
state | Required | Two char state name NC= North carolina |
Response:
JSON | XML |
---|---|
Success: {"total":321, "data":{"ACME":"ACME", ... "ZEBULON":"ZEBULON"}} | Success: <result><total>321</total><data><ACME>ACME</ACME>....<ZEBULON>ZEBULON</ZEBULON></data></result> |
listAvailableDids [GET] [IFAXENTERPRISE]
Display list of available DIDs
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XGET https://api2.questblue.com/fax/available -d "{\"type\": \"1b\",\"state\": \"NC\",\"ratecenter\": \"RALEIGH\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxenterprise.php");
//Create a new instance of the class
$ifaxenterprise = new Ifaxenterprise;
//Grab the response and store it for later use
$response = $ifaxenterprise->listAvailableDids("1b","NC","RALEIGH");
//Print the response to the screen
print($response);
?>
Output: {"total":107,"data":["9194108535"..........."9842389679","9842389683","9842389686"]}
Get list of available Fax DIDs Local or toll free
Request Method and URL: GET https://api2.questblue.com/fax/available
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
type | DID type to list | Required | (string)local,tf(toll free),tf is not available for tier 2 |
state | For local DIDs only | Required for Local DIDs if no NPA is entered | (string) |
ratecenter | For local DIDs only | Required for Local DIDs if no NPA is entered | (string) |
zip | For local DIDs only | Optional. For tier 1b only. If ZIP is set then no NPA,state, or ratecenter is required. | (int)Five Chars |
npa | For local DIDs only | Optional. If NPA is set then no state and rate center is required. | (int)Three Chars |
code | For Toll Free DIDs only | Optional | (int)Two Char TF code |
Response:
JSON | XML |
---|---|
Success: {"total":20", data":["9194911062", … "9196989686"]} | Success: <result><total><data><row0>9194911062</row0>...<row19>9196989686</row19></data></total></result> |
orderDid [POST] [IFAXENTERPRISE]
Order a Fax DID
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPOST https://api2.questblue.com/fax2 -d "{\"did\": 3332224444,\"sname\": \"QB\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxenterprise.php");
//Create a new instance of the class
$ifaxenterprise = new Ifaxenterprise;
//Grab the response and store it for later use
$response = $ifaxenterprise->orderDid("3332224444","QB");
//Print the response to the screen
print($response);
?>
Output: 1
Order Local or Toll Free fax pro DID/ Create and configure Ifax enterprise account
Request Method and URL: POST https://api2.questblue.com/fax2
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
did | Fax DID to order | Required | (int) |
sname | Group short name to add to the fax number. The group must be created before ordering the DID | Required | (string) |
note | Fax DID note | Optional | (string) |
pin | Port Out Security PIN code. | Optional | (int)4 digit |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
Warning (Non Critical Error):{"warning":["Warning Message"]} | Warning (Non Critical Error): <response><warning><row0>Warning Message</row0></warning></response> |
Error: {"error":"Error message"} | Error: <response><error>Error message</error></response> |
listDids [GET] [IFAXENTERPRISE]
Display list of DIDs
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XGET https://api2.questblue.com/fax2
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxenterprise.php");
//Create a new instance of the class
$ifaxenterprise = new Ifaxenterprise;
//Grab the response and store it for later use
$response = $ifaxenterprise->listDids();
//Print the response to the screen
print($response);
?>
Output: {"total":1,"data":[{"did":9105050412,"status":"active","did_type":"local","sname":"marieifax2"}]}
List Ordered DIDs and thier configurations
Request Method and URL: GET https://api2.questblue.com/fax2
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
did | Fax DID to retrieve info. Support for Unix style DID searching. | Optional | (string)Min 3 char |
per_page | Number of records to list in a page. The default is 25 | Optional | (int) |
page | Page number to retrieve data from | Optional | (int) |
Response:
JSON | XML |
---|---|
Success: {"total":6, "total_pages":1, "current_page":1, "data":[ {"did":"9194911062", "status":"active", "did_type":"local", "note":"DID Note", "fax_name":"John Doe", "fax_login":"mylogin"},…. ]} | Success: <response><total>6</total><total_pages>9</total_pages><current_page>1</current_page><data><row0><did>9194911062</did><status>active</status><did_type>local</did_type><note>DID Note</note><fax_name>John Doe</fax_name ><fax_name>mylogin</fax_name></row0></data></response> |
updateDid [PUT] [IFAXENTERPRISE]
Update note for DID
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPUT https://api2.questblue.com/fax2 -d "{\"did\": 3332224444, \"note\",\"Test Note\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxenterprise.php");
//Create a new instance of the class
$ifaxenterprise = new Ifaxenterprise;
//Grab the response and store it for later use
$response = $ifaxenterprise->updateDid("3332224444","Test Note");
//Print the response to the screen
print($response);
?>
Output: 1
Update iFaxEnterprise DID Properties
Request Method and URL: PUT https://api2.questblue.com/fax2
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
did | Fax DID to manage | Required | (int) |
note | DID note | Optional | (string) |
pin | Port Out Security PIN code | Optional | (int) 4 digits |
sname | Group short name to update. Set an empty value to remove current group(delete Fax account) | Optional | (string) |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
deleteDid [DELETE] [IFAXENTERPRISE]
Remove DID from account
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XDELETE https://api2.questblue.com/fax2 -d "{\"did\": 3332224444}"
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxenterprise.php");
//Create a new instance of the class
$ifaxenterprise = new Ifaxenterprise;
//Grab the response and store it for later use
$response = $ifaxenterprise->deleteDid("3332224444");
//Print the response to the screen
print($response);
?>
Output: 1
Remove iFax Enterprise DID
Request Method and URL: DELETE https://api2.questblue.com/fax2
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
did | DID to remove | Required | (int) |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
Warning (Non Critical Error):{"warning":["Warning Message"]} | Warning (Non Critical Error): <response><warning><row0>Warning Message</row0></warning></response> |
Error: {"error":"Error message"} | Error: <response><error>Error message</error></response> |
createGroup [POST] [IFAXENTERPRISE]
Create Ifax group
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPOST https://api2.questblue.com/fax2/group -d "{\"sname\": \"qb\", \"name\": \"QuestBlue\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxenterprise.php");
//Create a new instance of the class
$ifaxenterprise = new Ifaxenterprise;
//Grab the response and store it for later use
$response = $ifaxenterprise->createGroup("qb","QuestBlue");
//Print the response to the screen
print($response);
?>
Output: 1
Create iFax Group of users(company)
Request Method and URL: POST https://api2.questblue.com/fax2/group
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
sname | Group short name | Required | (string) max 24 chars |
name | Group name | Required | (string) max 128 chars |
Response:
JSON | XML |
---|---|
Success: {"total":2, "data":[ {"sname":"shortName1", name":"long Name1"}, {"sname":"shortName1","name":"long Name2"} ] } | Success: <response><total>2</total><data><row0><sname>shortName1</sname><name>long Name1</name></row0><row1><sname>shortName2</sname><name>long Name2</name></row1></data></response> |
listGroups [GET] [IFAXENTERPRISE]
List Ifax groups
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XGET https://api2.questblue.com/fax2/group
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxenterprise.php");
//Create a new instance of the class
$ifaxenterprise = new Ifaxenterprise;
//Grab the response and store it for later use
$response = $ifaxenterprise->listGroups();
//Print the response to the screen
print($response);
?>
Output: n/a
List iFax Groups(companies) and thier properties
Request Method and URL: GET https://api2.questblue.com/fax2/group
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
sname | Group short name to show property | Optional | (string) |
Response:
JSON | XML |
---|---|
Success: {"total":2, "data":[ {"sname":"shortName1", name":"long Name1"}, {"sname":"shortName1","name":"long Name2"} ] } | Success: <response><total>2</total><data><row0><sname>shortName1</sname><name>long Name1</name></row0><row1><sname>shortName2</sname><name>long Name2</name></row1></data></response> |
updateGroup [PUT] [IFAXENTERPRISE]
Update Ifax group
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPUT https://api2.questblue.com/fax2/group -d "{\"sname\": qb, \"sname_new\": \"QB\",\"name_new\": \"QuestBlue\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxenterprise.php");
//Create a new instance of the class
$ifaxenterprise = new Ifaxenterprise;
//Grab the response and store it for later use
$response = $ifaxenterprise->updateGroup("qb","QB","QuestBlue");
//Print the response to the screen
print($response);
?>
Output: n/a
Update iFax Groups(companies) amd thier properties
Request Method and URL: PUT https://api2.questblue.com/fax2/group
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
sname | Existing group short name to modify | Required | (string) |
sname_new | New group short name | Required | (string)Max 24 chars |
name_new | New group name | Required | (string)Max 128 chars |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
Error: {"error":"Error message"} | Error: <response><error>Error message</error></response> |
deleteGroup [DELETE] [IFAXENTERPRISE]
Delete Ifax group
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XDELETE https://api2.questblue.com/fax2/group -d "{\"sname\": \"QB\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxenterprise.php");
//Create a new instance of the class
$ifaxenterprise = new Ifaxenterprise;
//Grab the response and store it for later use
$response = $ifaxenterprise->deleteGroup("QB");
//Print the response to the screen
print($response);
?>
Output: 1
Completely Remove iFax Enterprise Group
Request Method and URL: DELETE https://api2.questblue.com/fax2/group
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
sname | Group short name to remove | Required | (string) |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
Error: {"error":"Error message"} | Error: <response><error>Error message</error></response> |
createUser [POST] [IFAXENTERPRISE]
Create new user for the QB group
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPOST https://api2.questblue.com/fax2/user -d "{\"fax_login\": \"some_username\", \"fax_password\": \"some_password\", \"sname\": \"QB\", \"fax_name\": \"qbdev\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxenterprise.php");
//Create a new instance of the class
$ifaxenterprise = new Ifaxenterprise;
//Grab the response and store it for later use
$response = $ifaxenterprise->createUser("some_username","some_password","QB","qbdev");
//Print the response to the screen
print($response);
?>
Output: 1
Create new iFax Enterprise User for iFax Group
Request Method and URL: POST https://api2.questblue.com/fax2/user
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
fax_login | Fax user login | Required | (string)Max 36 chars |
fax_password | Fax user password | Required | (string)Max 64 chars |
sname | Group short name to add new user to | Required | (string) |
fax_name | Fax user first name | Required | (string)Max 48 chars |
fax_lname | Fax user last name | Optional | (string)Max 48 chars |
fax_email | Fax user contact email. Must be a valid email | Optional | (string) |
is_admin | Set the user admin privileges | Optional | (string)on,off(default) |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
Error: {"error":"Error message"} | Error: <response><error>Error message</error></response> |
listUsers [GET] [IFAXENTERPRISE]
List users from QB group
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XGET https://api2.questblue.com/fax2/user -d "{\"sname\": \"QB\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxenterprise.php");
//Create a new instance of the class
$ifaxenterprise = new Ifaxenterprise;
//Grab the response and store it for later use
$response = $ifaxenterprise->listUsers("QB");
//Print the response to the screen
print($response);
?>
Output: n/a
List existing iFax Enterprise Users
Request Method and URL: GET https://api2.questblue.com/fax2/user
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
sname | Fax group short name to view details | Optional | (string) |
fax_login | Fax user login to view details | Optional | (string) |
Response:
JSON | XML |
---|---|
Success: {"total":10, "total_pages":2, "current_page":1, "data"[ {"sname":"myGroupName", "fax_name":"John", "fax_lname":"Doe" "login":"mylogin", "password":"myPassword", "is_admin":"on"} …. ]} | Success: <response><total>10</total><data><row0><sname>myGroupName</sname><fax_name>John</fax_name><fax_lname>Doe</fax_lname><login>mylogin</login><password>myPassword</password><is_admin>on</is_admin></row0>….</data></response> |
Error: {"error":"Error message"} | Error: <response><error>Error Message</error></response> |
updateUser [PUT] [IFAXENTERPRISE]
Update fax user and set user account to admin
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPUT https://api2.questblue.com/fax2/user -d "{\"fax_login\": \"fax_username\", \"is_admin\": \"on\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxenterprise.php");
//Create a new instance of the class
$ifaxenterprise = new Ifaxenterprise;
//Grab the response and store it for later use
$response = $ifaxenterprise->updateUser("some_username",null,null,null,null,"on");
//Print the response to the screen
print($response);
?>
Output: n/a
Manage iFax Enterprise User Properties
Request Method and URL: PUT https://api2.questblue.com/fax2/user
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
fax_login | Fax user login to modify. The user must exist in your inventory | Required | (string) |
fax_password | Fax user password | Optional | (string)Max 64 chars |
fax_name | Fax user first name | Optional | (string)Max 48 chars |
fax_lname | Fax user last name | Optional | (string) |
fax_email | Fax user contact email. Must be a valid email | Optional | (string) |
is_admin | Set the user admin privileges. | Optional | (string)on,off(default) |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
Error: {"error":"Error message"} | Error: <response><error>Error message</error></response> |
deleteUser [DELETE] [IFAXENTERPRISE]
//Delete user from fax account
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XDELETE https://api2.questblue.com/fax2/user -d "{\"fax_login\": \"some_username\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxenterprise.php");
//Create a new instance of the class
$ifaxenterprise = new Ifaxenterprise;
//Grab the response and store it for later use
$response = $ifaxenterprise->deleteUser("some_username");
//Print the response to the screen
print($response);
?>
Output: n/a
Completely remove iFax Enterprise User
Request Method and URL: DELETE https://api2.questblue.com/fax2/user
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
fax_login | Fax user login to modify. The user must exist in your inventory | Required | (string) |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
Error: {"error":"Error message"} | Error: <response><error>Error message</error></response> |
updateUserPermissions [POST] [IFAXENTERPRISE]
Update user and give all permissions
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPOST https://api2.questblue.com/fax2/permit -d "{\"fax_login\": \"some_username\", \"did\": 3332224444, \"allow_send\": \"on\", \"allow_delete\": \"on\", \"allow_list_in\": \"on\", \"list_sent\": \"on\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxenterprise.php");
//Create a new instance of the class
$ifaxenterprise = new Ifaxenterprise;
//Grab the response and store it for later use
$response = $ifaxenterprise->updateUserPermissions("some_username","3332224444","on","on","on","on");
//Print the response to the screen
print($response);
?>
Output: n/a
Create or Update iFax Enterprise User Permissions
Request Method and URL: POST https://api2.questblue.com/fax2/permit
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
fax_login | Fax User Login to manage permissions,The user must exist in your inventory | Required | (string) |
did | Fax DID to manage permissions. Must be active DID. | Required | (int) |
allow_send | Allow fax sending | Required | (string)on,off |
allow_delete | Allow fax deletion | Required | (string)on,off |
allow_list_in | Allow viewing of inbound faxes | Required | (string)on,off |
list_sent | Allow viewing of outbound faxes. | Required | (string)on,off |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
Error: {"error":"Error message"} | Error: <response><error>Error message</error></response> |
listUserPermissions [GET] [IFAXENTERPRISE]
List all user and thier permissions
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XGET https://api2.questblue.com/fax2/permit -d "{\"fax_login\": \"some_username\", \"did\": 3332224444}"
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxenterprise.php");
//Create a new instance of the class
$ifaxenterprise = new Ifaxenterprise;
//Grab the response and store it for later use
$response = $ifaxenterprise->listUserPermissions("some_usernmae","3332224444");
//Print the response to the screen
print($response);
?>
Output: {"total":1,"data":[{"create_date":"Feb 3, 2020","fax_login":"
","did": ,"allow_send":"on","allow_delete":"on","allow_list_in":"on","allow_list_out":"on"}]}
List iFax Enterprise Users Permissions
Request Method and URL: GET https://api2.questblue.com/fax2/permit
Params to Send:
Parameters | Description | Mandatory | Values |
---|---|---|---|
fax_login | Fax user login to show permissions | Optional | (string) |
did | Fax Enterprise DID to show permissionss | Optional | (int) |
Response:
JSON | XML |
---|---|
Success: {"total":10, "total_pages":2, "current_page":1, "data":[ {"create_date":"Mar 12, 2019", "fax_login":"myFaxLogin", "did":"3025490877", "allow_send":"off", "allow_delete":"off", "allow_list_in":"off", "allow_list_out":"off"}, …. ]} | Success: <response><total>10</total><total_pages>2</total_pages><current_page>1</current_page><data><row0><create_date>Mar 12, 2019</create_date><fax_login>myFaxLogin</fax_login><did>3025490877</did><allow_send>off</allow_send><allow_delete>off</allow_delete><allow_list_in>off</allow_list_in><allow_list_out>off</allow_list_out></row0>….</data></response> |
Error: {"error":"Error message"} | Error: <response><error>Error message</error></response> |
deleteUserPermissions [DELETE] [IFAXENTERPRISE]
Delete user permissions
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XDELETE https://api2.questblue.com/fax2/permit -d "{\"fax_login\": \"some_username\", \"did\": 3332224444}"
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxenterprise.php");
//Create a new instance of the class
$ifaxenterprise = new Ifaxenterprise;
//Grab the response and store it for later use
$response = $ifaxenterprise->deleteUserPermissions("some_username","3332224444");
//Print the response to the screen
print($response);
?>
Output: n/a
Delete iFax Enterprise User Permissions
Request Method and URL: DELETE https://api2.questblue.com/fax2/permit
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
fax_login | Fax user login to delete4 permissions | Required | (string) |
did | Fax Enterprise DID to delete permissions | Required | (int) |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
Error: {"error":"Error message"} | Error: <response><error>Error message</error></response> |
updateEmailPermissions [POST] [IFAXENTERPRISE]
//Give user all permissions
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPOST https://api2.questblue.com/fax2/email -d "{\"did\", 3332224444, \"email\": \"some_email@example.com\", \"allow_send\": \"on\", \"allow_recieve\": \"on\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxenterprise.php");
//Create a new instance of the class
$ifaxenterprise = new Ifaxenterprise;
//Grab the response and store it for later use
$response = $ifaxenterprise->updateEmailPermissions("3332224444","some_email@example.com","on","on");
//Print the response to the screen
print($response);
?>
Output: n/a
Create or Update iFax Enterprise Email Permissions
Request Method and URL: POST https://api2.questblue.com/fax2/email
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
did | Fax Enterprise DID to set email permissions | Required | (int) |
Email address to set permissions | Required | (string) | |
allow_send | Allow send faxes | Optional | (string) |
allow_recieve | Allow Receive faxes | Optional | (string) |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
Error: {"error":"Error message"} | Error: <response><error>Error message</error></response> |
listEmailPermissions [POST] [IFAXENTERPRISE]
List email permissions
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPOST https://api2.questblue.com/fax2/email -d "{\"did\": 3332224444, \"email\": \"some_email@example.com\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxenterprise.php");
//Create a new instance of the class
$ifaxenterprise = new Ifaxenterprise;
//Grab the response and store it for later use
$response = $ifaxenterprise->listEmailPermissions("3332224444","some_email@example.com");
//Print the response to the screen
print($response);
?>
Output: {"total":1,"data":[{"sname":"QB","did":
,"email":" ","allow_send":"on","allow_receive":"on"}]}
List iFax Enterprise email permissions inventory
Request Method and URL: POST https://api2.questblue.com/fax2/email
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
did | Fax Enterprise DID to list email permissions | Optional | (int) |
Email address to list email permissions | Optional | (string) |
Response:
JSON | XML |
---|---|
Success: {"total":10, "total_pages":2, "current_page":1, "data":[ {"sname":"myFaxLogin","did":"3025490877", "email":"john@doe.com", "allow_send":"on", "allow_receive":"on"}, …. ]} | Success: <response><total>10</total><total_pages>2</total_pages><current_page>1</current_page><data><row0><sname>myFaxLogin</sname><did>3025490877</did><email>john@doe.com</email><allow_send>on</allow_send><allow_receive>on</allow_receive></row0>....</data></response> |
Error: {"error":"Error message"} | Error: <response><error>Error message</error></response> |
deleteEmailPermissions [DELETE] [IFAXENTERPRISE]
Delete email permissions
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XDELETE https://api2.questblue.com/fax2/email -d "{\"did\": 3332224444, \"email\": \"some_email@example.com\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxenterprise.php");
//Create a new instance of the class
$ifaxenterprise = new Ifaxenterprise;
//Grab the response and store it for later use
$response = $ifaxenterprise->deleteEmailPermissions("3332224444","some_email@example.com");
//Print the response to the screen
print($response);
?>
Output: n/a
Delete iFax Enterprise email permissions record
Request Method and URL: GET https://api2.questblue.com/fax2/email
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
did | Fax Enterprise DID to delete email permissions | Required | (int) |
Email address to delete email permissions | Required | (string) |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
Error: {"error":"Error message"} | Error: <response><error>Error message</error></response> |
uploadFile [POST] [IFAXENTERPRISE]
Upload image from Google of Google
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPOST https://api2.questblue.com/fax2/upload -d "{\"file\": \"base64_encode_string\", \"filename\": \"image.png\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxenterprise.php");
//Create a new instance of the class
$ifaxenterprise = new Ifaxenterprise;
$imageLink = "https://storage.googleapis.com/gd-wagtail-prod-assets/images/evolving_google_identity_2x.max-4000x2000.jpegquality-90.jpg";
//Grab the response and store it for later use
$response = $ifaxenterprise->uploadFile($imageLink,"image_of_google.jpg");
//Print the response to the screen
print($response);
?>
Output: {"data":{"fax_id":
}}
Upload fax file to fax server
Request Method and URL: POST https://api2.questblue.com/fax2/upload
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
file | Base 64 encoded file content string | Required | (string)Max file size to upload: 5MB |
filename | Uploaded file name | Required | (string) |
Response:
JSON | XML |
---|---|
Success: {"data":{"fax_id":674944}} | Success: <response><data><fax_id>674945</fax_id></data></response> |
Error: {"error":"Error message"} | Error: <response><error>Error message</error></response> |
sendFax [POST] [IFAXENTERPRISE]
Send a fax
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPOST https://api2.questblue.com/fax2/send -d "{\"did_from\": 3332224444, \"did_to\": 1112223333, \"file_id\": 1}"
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxenterprise.php");
//Create a new instance of the class
$ifaxenterprise = new Ifaxenterprise;
//Grab the response and store it for later use
$response = $ifaxenterprise->sendFax("3332224444","1112223333","1");
//Print the response to the screen
print($response);
?>
Output: n/a
Send iFax
Request Method and URL: POST https://api2.questblue.com/fax2/send
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
did_from | Sender fax number. Must be active DID from your account | Required | (int)10 chars |
did_to | US based destination fax number | Required | (int)10 chars |
file_id | Uploaded File ID | Required | (int) |
Response:
JSON | XML |
---|---|
Success: {"data":{"fax_id":674944}} | Success: <response><data><fax_id>674945</fax_id></data></response> |
Error: {"error":"Error message"} | Error: <response><error>Error message</error></response> |
IFaxPro
listStates [GET] [IFAXPRO]
Display list of states
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XGET https://api2.questblue.com/fax/states
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxpro.php");
//Create a new instance of the class
$ifaxpro = new Ifaxpro;
//Grab the response and store it for later use
$response = $ifaxpro->listStates();
//Print the response to the screen
print($response);
?>
Output: {"total":60,"data":["AA","AB","AL","AR"....."UT","VA","VT","WA","WI","WV","WY"]}
List of states(short names) where at least one Rate Center is available
Request Method and URL: GET https://api2.questblue.com/fax/states
Params to Send: none
Response:
JSON | XML |
---|---|
Success: {"total":52, "data":["AA", … "WY"]} | Success: <result><total>52</total><data><row0>AA</row0>...<row51>WY</row51></data></result> |
listRateCenters [GET] [IFAXPRO]
Display list of ratecenters
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XGET https://api2.questblue.com/ratecenters -d "{\"state\: \"AB\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxpro.php");
//Create a new instance of the class
$ifaxpro = new Ifaxpro;
//Grab the response and store it for later use
$response = $ifaxpro->listRateCenters("AB");
//Print the response to the screen
print($response);
?>
Output: {"total":217,"data":["ACADIA VLY","ACME""ROCKYMT HS","ROSEBUD","RUMSEY","RYCROFT"..........."WILLINGDON","WOKING","WRENTHAM","YOUNGSTOWN"]}
List of Rate Centers for a State
Request Method and URL: GET https://api2.questblue.com/ratecenters
Params to Send:
Parameter | Description | Madatory | Values |
---|---|---|---|
state | Required | Two char state name NC= North carolina |
Response:
JSON | XML |
---|---|
Success: {"total":321, "data":{"ACME":"ACME", ... "ZEBULON":"ZEBULON"}} | Success: <result><total>321</total><data><ACME>ACME</ACME>....<ZEBULON>ZEBULON</ZEBULON></data></result> |
listAvailableDids [GET] [IFAXPRO]
Display list of available DIDs
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XGET https://api2.questblue.com/fax/available -d "{\"type\": \"1b\", \"state\": \"state\": \"NC\", \"ratecenter\": \"RALEIGH\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxpro.php");
//Create a new instance of the class
$ifaxpro = new Ifaxpro;
//Grab the response and store it for later use
$response = $ifaxpro->listAvailableDids("1b","NC","RALEIGH");
//Print the response to the screen
print($response);
?>
Output: {"total":107,"data":["9194108535"..........."9842389679","9842389683","9842389686"]}
Get list of available Fax DIDs Local or toll free
Request Method and URL: GET https://api2.questblue.com/fax/available
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
type | DID type to list | Required | (string)local,tf(toll free),tf is not available for tier 2 |
state | For local DIDs only | Required for Local DIDs if no NPA is entered | (string) |
ratecenter | For local DIDs only | Required for Local DIDs if no NPA is entered | (string) |
zip | For local DIDs only | Optional. For tier 1b only. If ZIP is set then no NPA,state, or ratecenter is required. | (int)Five Chars |
npa | For local DIDs only | Optional. If NPA is set then no state and rate center is required. | (int)Three Chars |
code | For Toll Free DIDs only | Optional | (int)Two Char TF code |
Response:
JSON | XML |
---|---|
Success: {"total":20", data":["9194911062", … "9196989686"]} | Success: <result><total><data><row0>9194911062</row0>...<row19>9196989686</row19></data></total></result> |
orderDid [POST] [IFAXPRO]
Order a Fax DID and create an account
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPOST https://api2.questblue.com/fax -d "{\"did\": 3332224444, \"fax_name\": \"some_name\", \"fax_email\": \"some_email@example.com\", \"fax_login\": \"some_username\", \"fax_password\": \"some_password\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxpro.php");
//Create a new instance of the class
$ifaxpro = new Ifaxpro;
//Grab the response and store it for later use
$response = $ifaxpro->orderDid("3332224444","","","some_name","some_email@example.com","some_username","some_password");
//Print the response to the screen
print($response);
?>
Output: 1
Order Local or Toll Free fax pro DID/ Create and configure Ifax pro account
Request Method and URL: POST https://api2.questblue.com/fax
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
did | Fax DID to order | Required | (int) |
note | Fax DID note | Optional | (string) |
pin | Port Out Security PIN Code | Optional | (int) 4 digit |
fax_name | Fax username | Required | (string) |
fax_email | Fax user email address | Required | (string) |
fax_login | Fax user login | Required | (string) |
fax_password | Fax user password | Required | (string) |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
listDids [GET] [IFAXPRO]
Display list of DIDs
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XGET https://api2.questblue.com/fax
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxpro.php");
//Create a new instance of the class
$ifaxpro = new Ifaxpro;
//Grab the response and store it for later use
$response = $ifaxpro->listDids();
//Print the response to the screen
print($response);
?>
Output: {"total":4,"data":[{"did":9192301271,"status":"active","did_type":"local","fax_name":"mjacobstest","fax_login":"mjacobstest"}..........]}
List Ordered DIDs and thier configurations
Request Method and URL: GET https://api2.questblue.com/fax
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
did | Fax DID to retrieve info. Support for Unix style DID searching. | Optional | (string)Min 3 char |
per_page | Number of records to list in a page. The default is 25 | Optional | (int) |
page | Page number to retrieve data from | Optional | (int) |
Response:
JSON | XML |
---|---|
Success: {"total":6, "total_pages":1, "current_page":1, "data":[ {"did":"9194911062", "status":"active", "did_type":"local", "note":"DID Note", "fax_name":"John Doe", "fax_login":"mylogin"},…. ]} | Success: <response><total>6</total><total_pages>9</total_pages><current_page>1</current_page><data><row0><did>9194911062</did><status>active</status><did_type>local</did_type><note>DID Note</note><fax_name>John Doe</fax_name ><fax_name>mylogin</fax_name></row0></data></response> |
updateDid [PUT] [IFAXPRO]
Update DID and add a note
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPUT https://api2.questblue.com/fax -d "{\"did\": 3332224444, \"note\": \"This is a test note\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxpro.php");
//Create a new instance of the class
$ifaxpro = new Ifaxpro;
//Grab the response and store it for later use
$response = $ifaxpro->updateDid("3332224444","This is a test note");
//Print the response to the screen
print($response);
?>
Output: 1
Manage Active Fax DID Configuration and Settings
Request Method and URL: PUT https://api2.questblue.com/fax
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
did | Fax DID to manage | Required | (int) |
note | DID note | Optional | (string) |
pin | Port Out Security PIN code | Optional | (int) min 4 char |
unset_acc | Remove Fax account. This method has a priority of fax name,email,login,password parameters assigned in the same request | Optional | (string) |
fax_name | Fax username | Required to create iFax.pro account | (string) |
fax_email | Fax user email address | Required to create iFax.pro account | (string) |
fax_login | Fax user login | Required to create iFax.pro account | (string) |
fax_password | Fax user password | Required to create iFax.pro account | (string) |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
Warning (Non Critical Error): {"warning":["Warning Message"]} | Warning (Non Critical Error): <response><warning><row0>Warning Message</row0></warning></response> |
Error: {"error":"Error message"} | Error: <response><error>Error message</error></response> |
deleteDid [DELETE] [IFAXPRO]
Remove DID from account
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XDELETE https://api2.questblue.com/fax -d "{\"did\": 3332224444}"
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxpro.php");
//Create a new instance of the class
$ifaxpro = new Ifaxpro;
//Grab the response and store it for later use
$response = $ifaxpro->deleteDid("3332224444");
//Print the response to the screen
print($response);
?>
Output: 1
Manage Active Fax DID Configuration and Settings
Request Method and URL: DELETE https://api2.questblue.com/fax
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
did | Fax DID to remove | Required | (int) |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
Warning (Non Critical Error): {"warning":["Warning Message"]} | Warning (Non Critical Error): <response><warning><row0>Warning Message</row0></warning></response> |
Error: {"error":"Error message"} | Error: <response><error>Error message</error></response> |
sendFax [POST] [IFAXPRO]
Send fax
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPOST https://api2.questblue.com/fax/send -d "{\"did_from\": 3332224444, \"did_to\": 1112223333, \"file\": \"https://example.com/image.png\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxpro.php");
//Create a new instance of the class
$ifaxpro = new Ifaxpro;
//Grab the response and store it for later use
$response = $ifaxpro->sendFax("3332224444","1112223333","/relative/path/to/file.pdf");
//Print the response to the screen
print($response);
?>
Output: {"data":{"fax_id":
}}
Send iFax
Request Method and URL: POST https://api2.questblue.com/fax/send
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
file | Base 64 encoded file content string. Maximum file size to upload 5Mb | Required | (string)jpeg, jpg, gif, png, tif, tiff, pdf, doc, rtf, ods, xls, csv, ppt, txt, rar, zip, 7z4 |
filename | Uploaded file name | Required | (string) |
did_from | Sender Fax Number | Required | (int)Active DID from your account |
did_to | Ten digit US-based Destination Fax Number. | Required | (int) |
Response:
JSON | XML |
---|---|
Success: {"data":{"fax_id":674944}} | Success: <response><data><fax_id>674945</fax_id></data></response> |
Error: {"error":"Error message"} | Error: <response><error>Error message</error></response> |
move2voice [PUT] [DID]
Move Fax DID to Voice Inventory
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPUT https://api2.questblue.com/fax/move2voice -d "{\"did\": 3332224444}"
<?php
//Require the neccesary class once
require_once("api_v2/Ifaxpro.php");
//Create a new instance of the class
$ifaxpro = new Ifaxpro;
//Grab the response and store it for later use
$response = $ifaxpro->move2voice("3332224444");
//Print the response to the screen
print($response);
?>
Move Fax DID to Voice Inventory
Request Method and URL: PUT https://api2.questblue.com/fax/move2voice
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
did | DID to move | Required | (int) |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
Error: {"error":"Error message"} | Error: <response><error>Error Messsage</error></response> |
Interdids
listCountries [GET] [INTERDIDS]
Display list of countries
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XGET https://api2.questblue.com/didinter/countrylist
<?php
//Require the neccesary class once
require_once("api_v2/Interdids.php");
//Create a new instance of the class
$interdids = new Interdids;
//Grab the response and store it for later use
$response = $interdids->listCountries();
//Print the response to the screen
print($response);
?>
Output: {"total":43,"data":[{"code":"DZ","country":"Algeria"}.....{"code":"VN","country":"Vietnam"}]}
Get Available Country List
Request Method and URL: GET https://api2.questblue.com/didinter/countrylist
Params to Send: none
Response:
JSON | XML |
---|---|
Success: {"total":43, "data":[ {"code":"DZ","country":"Algeria"}, …. {"code":"VN","country":"Vietnam"} ]} | Success: <response><total>43</total><data><row0><code>DZ</code><country>Algeria</country></row0></data></response> |
listCities [GET] [INTERDIDS]
Display List of cities
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XGET https://api2.questblue.com/didinter/citylist -d "{\"country_code\": \"DZ\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Interdids.php");
//Create a new instance of the class
$interdids = new Interdids;
//Grab the response and store it for later use
$response = $interdids->listCities("DZ");
//Print the response to the screen
print($response);
?>
Output: {"total":1,"data":["NATIONAL VOIP"]}
Get Available City List
Request Method and URL: GET https://api2.questblue.com/didinter/citylist
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
country_code | Required | (string)Two char country code obtained from listCountries |
Response:
JSON | XML |
---|---|
Success: {"total":21, "data":[ "BAHIA BLANCA", …. "VILLA MERCEDES" ]} | Success: <response><total><data><row0>BAHIA BLANCA</row0><row20>VILLA MERCEDES</row20></data></total></response> |
orderDid [POST] [INTERDIDS]
Order a International DID
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPOST https://api2.questblue.com/didinter -d "{\"country_code\": \"DZ\", \"city\": \"NATIONAL VOIP\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Interdids.php");
//Create a new instance of the class
$interdids = new Interdids;
//Grab the response and store it for later use
$response = $interdids->orderDid("DZ","NATIONAL VOIP");
//Print the response to the screen
print($response);
?>
Output: 1
Order International DID
Request Method and URL: POST https://api2.questblue.com/didinter
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
country_code | Required | (string)Two char country code obtained from listCountries | |
city | City name obtained from listCities | Required | (string) |
forward2did | Obsolete in 2.1 please refer to route2trunk Local DID forward inbound call. Must be active DID in your account | Optional | (int) |
route2trunk | Route International DID to a SIP trunk. The trunk must be active. | Optional, set an empty value to unroute the DID | (string) |
Response:
JSON | XML |
---|---|
Success: {"did":2234567891} | Success: <response><did>2234567891</did></response> |
Warning: {"did":2234567891," warning":{"forward2did":"Set DID forwarding Error"}} | Warning: <response><did>2234567891</did><warning><rowforward2did>Set DID forwarding Error</rowforward2did></warning></response> |
Error: {"error":"DID Ordering Error"} | Error: <response><error>DID Ordering Error</error></response> |
listDids [GET] [INTERDIDS]
List dids with 10 results per page and display page 2
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XGET https://api2.questblue.com/didinter -d "{\"did\": 3332224444, \"per_page\": 10, \"page\": 2}"
<?php
//Require the neccesary class once
require_once("api_v2/Interdids.php");
//Create a new instance of the class
$interdids = new Interdids;
//Grab the response and store it for later use
$response = $interdids->listDids("3332224444",10,2);
//Print the response to the screen
print($response);
?>
Output: n/a
Get International DIDs List and Properties
Request Method and URL: GET https://api2.questblue.com/didinter
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
did | DID to retrieve info from | Optional | (int) |
per_page | Number of records to list in a page. | Optional | (int)Default 25, Set range of 5-200 |
page | Page number to retrieve data from | Optional | (int) |
Response:
JSON | XML |
---|---|
Success: {"total":17, "total_pages":4, "current_page":1, "data"[ {"did":"582127202550", "country":"Venezuela", "city":"CARACAS", "status":"active", "route2trunk":"trunkName"}, ... ]} | Success: <response><total>17</total><data><row0><did>582127202550</did><country>Venezuela</country><city>CARACAS</city><status>active</status><route2trunk>trunkName</route2trunk></row0></data></response> |
Error: {"error":"No International DIDs Found"} |
updateDid [PUT] [INTERDIDS]
Update did
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPUT https://api2.questblue.com/didinter -d "{\"did\": 3332224444, \"route2trunk\": \"my_trunk\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Interdids.php");
//Create a new instance of the class
$interdids = new Interdids;
//Grab the response and store it for later use
$response = $interdids->updateDid("3332224444","my_trunk");
//Print the response to the screen
print($response);
?>
Output: 1
Get International DIDs List and Properties
Request Method and URL: PUT https://api2.questblue.com/didinter
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
did | DID to manage | Required | (int) |
forward2did | Obsolete in 2.1 please refer to route2trunk Local DID to forward Inbound Call. Must be active DID in your account. Set empty or unset the variable to remove forwarding. | Optional | (int) |
route2trunk | Route International DID to a SIP trunk. The trunk must be active. | Optional,Set an empty value to unroute the DID | (string) |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
Error: {"error":"DID Ordering Error"} | Error: <response><error>Error Message</error></response> |
deleteDid [DELETE] [INTERDIDS]
Delete a DID
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XDELETE https://api2.questblue.com/didinter -d "{\"did\": 3332224444}"
<?php
//Require the neccesary class once
require_once("api_v2/Interdids.php");
//Create a new instance of the class
$interdids = new Interdids;
//Grab the response and store it for later use
$response = $interdids->deleteDid("3332224444");
//Print the response to the screen
print($response);
?>
Output: 1
Completely Delete International DID
Request Method and URL: DELETE https://api2.questblue.com/didinter
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
did | DID to remove | Required | (int) |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
Error: {"error":"DID removal error"} | Error <response><error>DID removal error</error></response> |
LNP
<?php
require_once("api_v2/Lnp.php");
$lnp = new Lnp;
?>
private APICredential _apiCredential = new APICredential("username","password","privkey");
private LNP _lnp = new LNP(_apiCredential);
The LNP
class gives you access to methods that relate to LNP orders
checkPortability [GET] [LNP]
Check if number is portable
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XGET https://api2.questblue.com/lnp/check -d "{\"number2port\": 3332224444}"
<?php
//Require the neccesary class once
require_once("api_v2/Lnp.php");
//Create a new instance of the class
$lnp = new Lnp;
//Grab the response and store it for later use
$response = $lnp->checkPortability("3332224444");
//Print the response to the screen
print($response);
?>
string result = _lnp.CheckPortability("3332224444");
Console.WriteLine(result);
Output: {"data":{"foc_days":3}}
Check local number portability for specific TN
Request Method and URL: GET https://api2.questblue.com/lnp/check
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
number2port | US based TN to check portability | Required | (int |
Response:
JSON | XML |
---|---|
Success: {"data":{"foc_days":3}} | Success: <response><data><foc_days>3</foc_days></data></response> |
Error: {"error":"Error Message"} | Error: <response><error>Error message</error></response> |
createLnp [POST] [LNP]
Create a new LNP request
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPOST https://api2.questblue.com/lnp -d "{\"number2port\": 3332224444, \"provider_name\": \"Verizon\", \"account_no\": \"11111\", \"authorize_contact\": \"john doe\", \"contact_title\": \"ceo/owner\", \"street_name\": \"park avenue\", \"street_no\": \"1775\", \"city\": \"new york\" , \"zipcode\": \"23405\", \"billing_telephone_no\": 3332224444, \"bill_file\": \"base64_encoded_bill_file\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Lnp.php");
//Create a new instance of the class
$lnp = new Lnp;
//associative array of data for lnp request
$data = array(
"number2port" => [3332224444],
"provider_name" => "Verizon",
"account_no" => "11111",
"authorize_contact" => "john doe",
"contact_title" => "ceo/owner",
"street_name" => "park avenue",
"street_no" => "1775",
"city" => "new york",
"zipcode" => "23405",
"billing_telephone_number" => "3332224444",
"bill_file" => "http://linktoimage.com/image.png"
);
//Grab the response and store it for later use
$response = $lnp->createLnp($data);
//Print the response to the screen
print($response);
?>
CreateLNPModel lnpModel = new CreateLNPModel(){
"number2port" = "3332224444" ,
"provider_name" = "Verizon" ,
"account_no" = "11111" ,
"authorize_contact" = "john doe" ,
"contact_title" = "ceo/owner" ,
"street_name" = "park avenue" ,
"street_no" = "1775" ,
"city" = "new york" ,
"zipcode" = "23405" ,
"billing_telephone_no" = "3332224444" ,
"bill_file" = "http://linktoimage.com/image.png" ,
"bill_filename" = "image.png"
};
string result = _lnp.CreateLnp(lnpModel);
Console.WriteLine(result);
Output: {"data":[ {"id":"12345" ] }
Create new local number portability request
Request Method and URL: POST https://api2.questblue.com/lnp
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
number2port | US based porting TN | Required | (int) |
provider_name | Current server provider name | Required | (string)Maxx 255 chars |
account_no | Server provider account number | Required | (string) |
authorize_contact | Authorized contact | Required | (string) |
contact_title | Contact title | Required | (string) |
street_name | Street name | Required | (string)Max 100 chars |
street_no | Service street number | Required | (string)Max 50 chars |
city | Service city | Required | (string)Max 100 chars |
state | Service state | Optional | (string) |
zipcode | Service zipcode | Required | (mixed)Max 20 chars |
billing_telephone_no | US based billing telephone number | Required | (int)Ten chars |
bill_file | Base64 encoded full path phone bill files (scan, photo). | Required | (string)GIF, JPG, PNG or PDF file. Size up to 5Mb. |
foc_date | Request FOC date. Is not available when porting mobile DID | Optional | (string) Format YYYY-MM-DD |
activate_time | Request FOC activation (only 9am-4pm EST available) | Optional | (string)Format HH:00(EST) |
did_mode | Type of DID | Optional | (string)voice,fax,Default voice |
partial_port | Partial port | Optional | (string)yes,no, Default no |
extra_services | Additional remaining services | Required if partial_port is set to yes | (string) |
location | Service Location | Optional | (string)business,residential |
company | Company Name | Required if location is set to business | (string) |
wireless_no | Wireless number type | Optional | (string)yes,no, Default no |
pincode | Wireless account PIN code | Required if wireless_no is set to yes | (int) |
ssn | SSN last four digits | Required if wireless_no is set to yes | (int) |
lidb_list | LIDB/Directory listings | Optional | (string)yes,no, Default no |
dir_prefix | Dir prefix | Optional | (string)None, N, NE, E, SE, S, SW, W, NW. Max. 10 chars |
dir_suffix | Dir suffix | Optional | (string)None, N, NE, E, SE, S, SW, W, NW. Max. 10 chars |
service_unit | Service suite/unity | Optional | (string)Max 100 chars |
Response:
JSON | XML |
---|---|
Success: {"data":[ {"id":"12345" ] } | Success: <response><data><row0><id>12345</id></row0></data></response> |
Warning (Non Critical Error):{"warning":["Warning Message"]} | Warning (Non Critical Error): <response><warning><row0>Warning Message</row0></warning></response> |
Error: {"error":"Error message"} | Error: <response><error>Error message</error></response> |
listLnp [GET] [LNP]
List all LNP request
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XGET https://api2.questblue.com/lnp
<?php
//Require the neccesary class once
require_once("api_v2/Lnp.php");
//Create a new instance of the class
$lnp = new Lnp;
//Grab the response and store it for later use
$response = $lnp->listLnp();
//Print the response to the screen
print($response);
?>
string result = _lnp.ListLnp();
console.WriteLine(result);
Output: {"total":1,"data":[{"number2port":"8457898207","id":17864,"created_by":"2020-02-04T19:28:00+00:00","status":"submitted","foc_date":"2020-02-07T17:00:00+00:00","did_mode":"voice","partial_port":"no","location":"business","company":"My Company Name","wireless_no":"no","lidb_list":"no","provider_name":"Verizon","account_no":"11111","authorize_contact":"john doe","contact_title":"ceo\/owner","street_no":"1775","dir_prefix":"None","street_name":"park avenue","dir_suffix":"NE","service_unit":"87","city":"new york","zipcode":"23405","billing_telephone_no":"1111111111111"}]}
List active local number portability request
Request Method and URL: GET https://api2.questblue.com/lnp
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
number2port | Porting numbers to list properties. The method suppoorts unix style porting number searching | Optional | (int |
id | The LNP carrier ID | Optional | (int |
per_page | Number of records to show per page. | Optional | (int)range 1-200, Default 10 |
page | Page to show | Optional | (int) |
Response:
JSON | XML |
---|---|
Success: {"total":18, "total_pages":2, "current_page":1, "data":[ {"number2port":"2232333844", "id":"12345", "created_by":"1970-01-01T00:00:00+00:00", "status":"submitted", "foc_date":"2019-04-12T17:00:00+00:00", "did_mode":"voice", "trunk":"myTrunkName", "partial_port":"no", "location":"business", "company":"My Company Name", "wireless_no":"no", "lidb_list":"no", "provider_name":"My Provider Name", "account_no":"111", "authorize_contact":"John Doe", "contact_title":"CEO", "street_no":"13", "dir_prefix":"None", "street_name":"Park Avenue", "dir_suffix":"NE", "service_unit":"87", "city":"Houston", "zipcode":"55346", "billing_telephone_no":"3032051420"}, …. ] } | Success: <response><total>18</total><total_pages>2</total_pages><current_page>1</current_page><data><row0><number2port>2232333844</number2port><id>12345</id><created_by>1970-01-01T00:00:00+00:00</created_by><status>submitted</status><foc_date>2019-04-12T17:00:00+00:00</foc_date><did_mode>voice</did_mode><trunk>myTrunkName</trunk><partial_port>no</partial_port><location>business</location><company>My Company Name</company><wireless_no>no</wireless_no><lidb_list>no</lidb_list><provider_name>My Provider Name</provider_name><account_no>111</account_no><authorize_contact>John Doe</authorize_contact><contact_title>CEO</contact_title><street_no>17342</street_no><dir_prefix>None</dir_prefix><street_name>Park Avenue</street_name><dir_suffix>NE</dir_suffix><service_unit>87</service_unit><city>Houston</city><zipcode>55346</zipcode><billing_telephone_no>3042051420</billing_telephone_no></row0></data></response> |
updateLnp [PUT] [LNP]
Change provider to Verizon
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPUT https://api2.questblue.com/lnp -d "{\"id\": 0000, \"provider_name\": \"verizon\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Lnp.php");
//Create a new instance of the class
$lnp = new Lnp;
//associative array of data for lnp request
$data = array(
"number2port" => '0000',
"provider_name" => "verizon"
);
//Grab the response and store it for later use
$response = $lnp->updateLnp($data);
//Print the response to the screen
print($response);
?>
UpdateLNPModel updateLnpModel = new UpdateLNPModel{
id = "0000",
provider_name = "verizon"
};
string result = _lnp.UpdateLnp(updateLnpModel);
Console.WriteLine(result);
Output: n/a
Update an existing local number portability request
Request Method and URL: PUT https://api2.questblue.com/lnp
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
id | id of LNP | Required | (int) |
trunk | SIP trunk name to route DID on porting complete(For voice dids Only) | Optional | (string) |
provider_name | Current server provider name | Optional | (string)Maxx 255 chars |
account_no | Server provider account number | Optional | (string) |
authorize_contact | Authorized contact | Optional | (string) |
contact_title | Contact title | Optional | (string) |
street_name | Street name | Optional | (string)Max 100 chars |
street_no | Service street number | Optional | (string)Max 50 chars |
city | Service city | Optional | (string)Max 100 chars |
state | Service state | Optional | (string) |
zipcode | Service zipcode | Optional | (mixed)Max 20 chars |
billing_telephone_no | US based billing telephone number | Optional | (int)Ten chars |
bill_file | Base64 encoded full path phone bill files (scan, photo). | Optional | (string)GIF, JPG, PNG or PDF file. Size up to 5Mb. |
foc_date | Request FOC date. Is not available when porting mobile DID | Optional | (string) Format YYYY-MM-DD |
activate_time | Request FOC activation | Optional | (string)Format HH:00(EST) |
did_mode | Type of DID | Optional | (string)voice,fax,Default voice |
partial_port | Partial port | Optional | (string)yes,no, Default no |
extra_services | Additional remaining services | Required if partial_port is set to yes | (string) |
location | Service Location | Optional | (string)business,residential |
company | Company Name | Required if location is set to business | (string) |
wireless_no | Wireless number type | Optional | (string)yes,no, Default no |
pincode | Wireless account PIN code | Required if wireless_no is set to yes | (int) |
ssn | SSN last four digits | Required if wireless_no is set to yes | (int) |
lidb_list | LIDB/Directory listings | Optional | (string)yes,no, Default no |
dir_prefix | Dir prefix | Optional | (string)None, N, NE, E, SE, S, SW, W, NW. Max. 10 chars |
dir_suffix | Dir suffix | Optional | (string)None, N, NE, E, SE, S, SW, W, NW. Max. 10 chars |
service_unit | Service suite/unity | Optional | (string)Max 100 chars |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
Warning (Non Critical Error):{"warning":["Warning Message"]} | Warning (Non Critical Error): <response><warning><row0>Warning Message</row0></warning></response> |
Error: {"error":"Error message"} | Error: <response><error>Error message</error></response> |
deleteLnp [DELETE] [LNP]
Remove active LNP request
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XDELETE https://api2.questblue.com/lnp -d "{\"id\": 0000}"
<?php
//Require the neccesary class once
require_once("api_v2/Lnp.php");
//Create a new instance of the class
$lnp = new Lnp;
//Grab the response and store it for later use
$response = $lnp->deleteLnp("0000");
//Print the response to the screen
print($response);
?>
string result = _lnp.DeleteLnp("0000");
Console.WriteLine(result);
Output: n/a
Remove Active Local Number Portability Request
Request Method and URL: DELETE https://api2.questblue.com/lnp
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
id | The LNP order ID | Required | (int) |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
Warning (Non Critical Error):{"warning":["Warning Message"]} | Warning (Non Critical Error): <response><warning><row0>Warning Message</row0></warning></response> |
Error: {"error":"Error message"} | Error: <response><error>Error message</error></response> |
Reports
<?php
require_once("api_v2/Reports.php");
$reports = new Reports;
?>
private APICredential _apiCredential = new APICredential("username","password","privkey");
private Reports _reports = new Reports(_apiCredential);
The Reports
class gives you access to methods that retrieve data on for specific services
callHistory [GET] [REPORTS]
Get call history from January 1, 2022 to January 25, 2022
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XGET https://api2.questblue.com/callhistory -d "{\"period\": [1580515200,1580860800]}"
<?php
//Require the neccesary class once
require_once("api_v2/Reports.php");
//Create a new instance of the class
$reports = new Reports;
//Grab the response and store it for later use
$response = $reports->callHistory(null,[1641013200,1642827600]);
//Print the response to the screen
print($response);
?>
CallHistoryModel callHistoryModel = new CallHistoryModel()
{
period = new int[] { 1641013200, 1642827600 }
};
string response = _reports.CallHistory(callHistoryModel);
Console.WriteLine(response);
Output: {"total":36,"total_pages":4,"current_page":1,"data":[{"call_time":"2020-02-04T15:51:10+00:00","call_type":"Inbound Call","caller":"XXXXXXXXXXXXXXX","callee":"XXXXXXXXXXXXXX","call_status":"ok","call_duration_min":"0.20","billed_min":"1.00","rate":"0.0000","ccrf":"0.0000","cost":"0.0000","trunk_id":XXXXXXXXXXXXXX}...............{"call_time":"2020-02-03T19:14:24+00:00","call_type":"Inbound Call","caller":"XXXXXXXXXXXXXX","callee":"XXXXXXXXXXXXXX","call_status":"ok","call_duration_min":"0.46","billed_min":"1.00","rate":"0.0000","ccrf":"0.0000","cost":"0.0000","trunk_id":XXXXXXXXXXXXXXX}]}
Retrieve voice call history for a customer account, filtered by additional options
Request Method and URL: GET https://api2.questblue.com/callhistory
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
trunk | SIP Trunk name to retrieve calls. | Optional | (string |
period | Date options to see history | Optional | (mixed)Possible values: thishour– calls in this hour. Sending this request at 16:24 will return calls made within the range from 16:00 to 16:24 previoushour– calls in the previous hour. Sending this request at 16:24 will return calls made within the range from 15:00 to 16:00 today(default)– today's calls from 00:00 to current time yesterday– yesterday’s calls. Sending request at Jan 12, 16:24 will return calls made by Jan 11 within the range from 00:00 to 23:59 array[startDate, endDate] – Date range where startDate, endDate – unix Time Stamp. Maximal date range allowed - seven days |
success_call_only | Show successful calls only | Optional | (string)on,off |
did | Retrieve specific DID history | Optional | (int |
summary_only | Display call summary only | Optional | (string)on,off |
per_page | Number of records to list in a page | Optional | (int)range 5-500, Default 25 |
page | Page number to display | Optional | (int) |
Response:
JSON | XML |
---|---|
Success: Call Summary {"total":2, "data":[ {"call_type":"Outbound Local Call", "call_number":25, "total_duration_min":"10.00", "cost":"0.12"}, …. ]} Detailed Report {"total":10, "total_pages":2, "current_page":1, "data":[ {"call_time":"2019-01-17T05:00:01+00:00", (ISO 8601) "call_type":"Outbound Zone 2 Call", "caller":"13368467101", "callee":"8282021141", "call_status":"ok", "call_duration_min":"10.00", "billed_min":"10.00", "rate":"0.01", "ccrf":"0.002", "cost":"0.12"}, …. ]} | Success: Call Summary <response><total>2</total><data><row0><call_type>Outbound Local Call</call_type><call_number>25</call_number><total_duration_min>10.00</total_duration_min><cost>0.12</cost></row0>….</data></response> Detailed Report <response><total>10</total><total_pages>2</total_pages><current_page>1</current_page><data><row0><call_time>2019-01-17T05:00:01+00:00</call_time><call_type>Outbound Zone 2 Call</call_type><caller>13368467101</caller><callee>8282021141</callee><call_status>ok</call_status><call_duration_min>10.00</call_duration_min><billed_min>10.00</billed_min><rate>0.01</rate><ccrf>0.002</ccrf><cost>0.12</cost></row0>….</data></response> |
faxHistory [GET] [REPORTS]
Get call history from January 1, 2022 to January 25, 2022
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XGET https://api2.questblue.com/faxhistory -d "{\"service\": \"pro\", \"period\": [1580515200,1580947200]}"
<?php
//Require the neccesary class once
require_once("api_v2/Reports.php");
//Create a new instance of the class
$reports = new Reports;
//Grab the response and store it for later use
$response = $reports->faxHistory(null,"pro",null,null,[1641013200,1642827600]);
//Print the response to the screen
print($response);
?>
FaxHistoryModel callHistoryModel = new FaxHistoryModel()
{
period = new int[] { 1641013200, 1642827600 }
};
string response = _reports.CallHistory(callHistoryModel);
Console.WriteLine(response);
Output: n/a
Retrive history of fax activity for a customer account, filtered by additional parameters
Request Method and URL: GET https://api2.questblue.com/faxhistory
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
did | DID to list fax history | Optional | (int |
service | Type of fax to list history- fax pro or fax enterprise | Optional | (string)pro,enterprise |
type | List of inbound or outbound faxes | Optional | out,in |
fax_id | List only some specific fax by Fax ID | Optional | (string) |
period | Time rand to list history | Optional | (string |
per_page | Number of records to show per page | Optional | (int) range 10-200, Default 25 |
page | Page number to show | Optional | (int) |
Response:
JSON | XML |
---|---|
Success: {"total":49, "total_pages":10, "current_page":1, "data":[ {"fax_id":674949, "send_time":"2019-03-20T12:25:24+00:00", "did_from":"4037689155", "did_to":"4037689155", "type":"out", "service":"enterprise", "status":"processing"}, …. ]} | Success: <response><total>49</total><total_pages>10</total_pages><current_page>1</current_page><data><row0><fax_id>674949</fax_id><send_time>2019-03-20T12:25:24+00:00</send_time><did_from>4037689155</did_from><did_to>4037689155</did_to><type>out</type><service>enterprise</service><status>processing</status></row0>….</data></response> |
Servers
<?php
require_once("api_v2/Servers.php");
$servers = new Servers;
?>
private APICredential _apiCredential = new APICredential("username","password","privkey");
private Servers _servers = new Servers(_apiCredential);
The Servers
class gives you access to methods that allow the ordering, updating, and deleting of servers
orderServer [POST] [SERVERS]
Order a small qube server
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPOST https://api2.questblue.com/server -d "{\"server_type\": \"dedicated\", \"note\": \"Note for support team\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Servers.php");
//Create a new instance of the class
$servers = new Servers;
//Grab the response and store it for later use
$response = $servers->orderServer("dedicated","Note for support team");
//Print the response to the screen
print($response);
?>
QubeServer qubeServer = new QubeServer(){
pbxadmin_password = "supersecurepassword",
email = "myemail@example.com",
inbound_trunk_name = "mytrunk"
};
string result = _server.OrderServer("small",qubeServer);
Console.WriteLine(result);
Output: {"data":{"server_id":1355}}
Regular or QuBe server - order a virtual or dedicated server
Request Method and URL: POST https://api2.questblue.com/server
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
server_type | Server type: Regular or QuBe(Graphical interface to asterisk installed) | Required | (string)small,medium,large,enterprise |
Available values and descriptions: | Obsolete values: dedicated,qubededicated, qubevirtual | ||
small – Small Hosted Server | |||
Cores: 2 | |||
Ram: 2GB | |||
Disk Space: 10GB | |||
medium - Medium Hosted Server | |||
Cores: 4 | |||
Ram: 4GB | |||
Disk: 25GB | |||
large - Large Hosted Server | |||
Cores: 6 | |||
Ram: 8GB | |||
Disk: 50GB | |||
enterprise - Enterprise Server | |||
Cores: 8 | |||
Ram: 16GB | |||
Disk: 100GB | |||
enterprise_plus - Enterprise++ Server | |||
Cores: 8 | |||
Ram: 32GB | |||
Disk: 100GB | |||
note | Note or comment | Optional | (string)Max 255 chars |
Response:
JSON | XML |
---|---|
Success: {"data":{"server_id":10522}} | Success: <response><data><server_id>10522</server_id></data></response> |
listServers [GET] [SERVERS]
List server with id of 1355
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XGET https://api2.questblue.com/server -d "{\"server_id\": 1355}"
<?php
//Require the neccesary class once
require_once("api_v2/Servers.php");
//Create a new instance of the class
$servers = new Servers;
//Grab the response and store it for later use
$response = $servers->listServers("1355");
//Print the response to the screen
print($response);
?>
string result = _server.ListServers("1355");
Console.WriteLine(result);
Output: {"total":1,"data":[{"server_id":1355,"type":"dedicated","ordered_by":"2020-02-06","status":"pending"}]}
List inventory and properties of ordered servers
Request Method and URL: GET https://api2.questblue.com/server
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
server_id | Server ID to show | Optional | (int |
Response:
JSON | XML |
---|---|
Success: {"total":2,"data":[ {"server_id":10522, "type":"vrtual", "ordered_by":"2019-01-23", "allowed_ip":["10.0.2.1","10.0.2.2"], "status":"active"} …. ]} | Success: <response><total>1</total><data><row0><server_id>10522</server_id><type>vrtual</type><ordered_by>2019-01-23</ordered_by><allowed_ip><row0>10.0.2.1</row0><row1>10.0.2.2</row1></allowed_ip><status>active</status></row0></data></response> |
addIp [PUT] [SERVERS]
Add IP to the firewall of our server with id of 1355
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPUT https://api2.questblue.com/server/addip -d "{\"server_id\": 1355, \"ip_address\": \"127.0.0.1\", \"note\": \"This is just a test\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Servers.php");
//Create a new instance of the class
$servers = new Servers;
//Grab the response and store it for later use
$response = $servers->addIp("1355","127.0.0.1","This is just a test");
//Print the response to the screen
print($response);
?>
string result = _server.AddIp("1355", "127.0.0.1", "This is just a test");
Console.WriteLine(result);
Output: n/a
Add an IP address to list of allowed IPs
Request Method and URL: PUT https://api2.questblue.com/server/addip
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
server_id | Server ID to ADD IP address | Required | (int) |
ip_address | IP address to add | Required | (string) |
note | Note or comment | Optional | (string)Max 64 chars |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
Warning (Non Critical Error):{"warning":["Warning Message"]} | Warning (Non Critical Error): <response><warning><row0>Warning Message</row0></warning></response> |
Error: {"error":"Error message"} | Error: <response><error>Error message</error></response> |
deleteIp [DELETE] [SERVERS]
Delete localhost ip from server with id of 1355
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XDELETE https://api2.questblue.com/server/deleip -d "{\"server_id\": \"1355\", \"ip_address\": \"127.0.0.1\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Servers.php");
//Create a new instance of the class
$servers = new Servers;
//Grab the response and store it for later use
$response = $servers->deleteIp("1355","127.0.0.1");
//Print the response to the screen
print($response);
?>
string result = _server.DeleteIp("1355", "127.0.0.1");
Console.WriteLine(result);
Output: n/a
Remove an IP address from allowed IP list
Request Method and URL: DELETE https://api2.questblue.com/server/deleip
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
server_id | Server ID to remove ip from | Required | (int) |
ip_address | Ip Address to remove from server | Required | (string) |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
Error: {"error":"Error message"} | Error: <response><error>Error message</error></response> |
deleteServers [DELETE] [SERVERS]
Delete server with id of 1355
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XDELETE https://api2.questblue.com/server -d "{\"server_id\": 1355}"
<?php
//Require the neccesary class once
require_once("api_v2/Servers.php");
//Create a new instance of the class
$servers = new Servers;
//Grab the response and store it for later use
$response = $servers->deleteServers("1355");
//Print the response to the screen
print($response);
?>
string result = _server.DeleteServers("1355");
Console.WriteLine(result);
Output: n/a
Remove server from account
Request Method and URL: DELETE https://api2.questblue.com/server
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
server_id | Server ID to remove | Required | (int) |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
Error: {"error":"Error message"} | Error: <response><error>Error message</error></response> |
Siptrunks
<?php
require_once("api_v2/Siptrunks.php");
$siptrunks = new Siptrunks;
?>
private APICredential _apiCredential = new APICredential("username","password","privkey");
private Siptrunks _siptrunks = new Siptrunks(_apiCredential);
The Siptrunks
class gives you access to methods that allow the creation, updating, and deleting of siptrunks
createTrunk [POST] [SIPTRUNKS]
Create new siptrunk
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPOST https://api2.questblue.com/siptrunk -d "{\"trunk\": \"testingTrunk\", \"password\": \"testpass\", \"ip_address\": \"127.0.0.1\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Siptrunks.php");
//Create a new instance of the class
$siptrunks = new Siptrunks;
//Grab the response and store it for later use
$response = $siptrunks->createTrunk("mytrunk",null,"1.1.1.1");
//Print the response to the screen
print($response);
?>
CreateTrunkModel createTrunkModel = new CreateTrunkModel(){
trunk = "mytrunk",
ip_address = "1.1.1.1"
};
string result = _siptrunks.CreateTrunk(createTrunkModel);
Console.WriteLine(result);
Output: n/a
Create new SIP trunk or Registration
Request Method and URL: POST https://api2.questblue.com/siptrunk
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
trunk | SIP Trunk Name to create. Two types of trunk are allowed – Static trunk and Registration. Must be unique within the system. Creating a Registration trunk must be allowed within your account by server admin. | Required, It must consist of alphanumeric characters and digits | (string)Max 15 chars |
password | Alphanumeric value only | Optional, Password will be assigned automatically if not entered | (string)Min 4 chars, Max 48 chars |
ip_address | IP address for static trunks only | Required for static trunks if no dynamic host is entered | (string) |
dynamic_host | Host(domain name) with dynamic IP address. The system will check the IP address of the host and automatically update it if there are changes | Optional. It overwrites ip_address if dynamic_host is set in the same request | (string) |
did | DID to route to the trunk. This must be an active DID not routed to other trunk. | Optional | (int |
inter_call | Allow to make international calls. This option must be enabled for your account by a server admin. | Optional | (string)on,off |
inter_limit | Limit daily cost for international calls | Optional the parameter will be ignored if international calls arnt enabled for your account and if inter_call isnt set to on | (int)range 1-1000 |
failover | Change trunks IP address on experiencing a specific number of timeout errors(failover_num) within a specific time(failover_time) | Optional | (mixed)Array – to set where: failover_ip_address (string)- new IP address to set on experiencing timeout errors failover_num(int)– range 1 to 100.Number of offline calls received within failover_time required to trigger failover failover_time(int) - Time window (in minutes) that system will check for failover_num calls. Possible values: 2, 3, 5, 7, 10, 15, 20, 30 |
concurrent_max | Limit the maximum number of concurrent channels | Optional | (int) Set 0 to remove preset limit |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
Error: {"error":"Error message"} | Error: <response><error>Error message</error></response> |
listTrunks [GET] [SIPTRUNKS]
List all trunks
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XGET https://api2.questblue.com/siptrunk
<?php
//Require the neccesary class once
require_once("api_v2/Siptrunks.php");
//Create a new instance of the class
$siptrunks = new Siptrunks;
//Grab the response and store it for later use
$response = $siptrunks->listTrunks();
//Print the response to the screen
print($response);
?>
string result = _siptrunks.ListTrunks();
Console.WriteLine(result);
Output: {"total":1,"data":[{"trunk":"testingTrunk","status":"on","ip_address":"127.0.0.1"}]}
Get properties for one specific trunk, or all trunks
Request Method and URL: GET https://api2.questblue.com/siptrunk
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
trunk | SIP Trunk name to get. single trunk will display more info then an array | Optional | (string |
per_page | Number of records to list per page | Optional | (int)range 5-200 Default 25 |
page | Page number to retrieve data from | Optional | (int) |
Response:
JSON | XML |
---|---|
Success: {"total":50, "total_pages":2, "current_page":1, "data":[ {"trunk":"myTrunkName ", "type":"static", "status":"on", "ip_address":"101.102.103.1", "routed_dids":["9194393755"], "inter_call":"on" }, …. ]} | Success: <response><total>50</total><total_pages>2</total_pages><current_page>1</current_page><data><row0><trunk>myTrunkName</trunk><type>static</type><ip_address>101.102.103.1</ip_address><status>on</status><routed_dids><row0>9194393755</row0></routed_dids><inter_call>on</inter_call></row0>...</data></response> |
updateTrunk [PUT] [SIPTRUNKS]
Update trunk passsword to newtestpass
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPUT https://api2.questblue.com/siptrunk -d "{\"trunk\": \"testingTrunk\", \"password\": \"newtestpass\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Siptrunks.php");
//Create a new instance of the class
$siptrunks = new Siptrunks;
//Grab the response and store it for later use
$response = $siptrunks->updateTrunk("mytrunk","newtestpass");
//Print the response to the screen
print($response);
?>
UpdateTrunkModel updateTrunkModel = new UpdateTrunkModel()
{
trunk = "mytrunk",
password = "newtestpass"
};
string result = _siptrunks.UpdateTrunk(updateTrunkModel);
Console.WriteLine(result);
Output: n/a
Update properties for a specific trunk Request Method and URL: PUT https://api2.questblue.com/siptrunk
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
trunk | SIP trunk name to manage | Required | (string) |
password | New SIP trunk password | Optional | (string) |
status | Enable or disable(lock) SIP trunk | Optional | (string)on,off |
ip_address | Change SIP trunk IP address for static trunks only | Optional | (string) |
dynamic_host | Host(domain name) with dynamic IP address. The system will check IP address of the host and automatically update it on changing. | Optional. It overwrites ip_address value if dynamic_host is set in the same request | (string) |
inter_call | Enable to allow international calls. The option itself must be enabled for your account by server admin | Optional | (string)Default disabled |
inter_limit | Limit daily cost for international calls | Optional The parameter will be ignored if international calls are not enabled for your account and if inter_call isn't set to on | (int)range 1-1000(USD) |
failover | Change trunks IP address on experiencing a specific number of timeout errors(failover_num) within a specific time(failover_time) |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
Warning (Non Critical Error):{"warning":["Warning Message"]} | Warning (Non Critical Error): <response><warning><row0>Warning Message</row0></warning></response> |
Error: {"error":"Error message"} | Error: <response><error>Error message</error></response> |
deleteTrunk [DELETE] [SIPTRUNKS]
Delete trunk with name "testtrunk"
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XDELETE https://api2.questblue.com/siptrunk -d "{\"trunk\": \"testtrunk\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Siptrunks.php");
//Create a new instance of the class
$siptrunks = new Siptrunks;
//Grab the response and store it for later use
$response = $siptrunks->deleteTrunk("mytrunk");
//Print the response to the screen
print($response);
?>
string result = _siptrunks.DeleteTrunk("mytrunk");
Console.WriteLine(result);
Output: n/a
Completely remove specific SIP trunk
Request Method and URL: DELETE https://api2.questblue.com/siptrunk
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
trunk | SIP trunk name to remove | Required | (string) |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
Warning (Non Critical Error):{"warning":["Warning Message"]} | Warning (Non Critical Error): <response><warning><row0>Warning Message</row0></warning></response> |
Error: {"error":"Error message"} | Error: <response><error>Error message</error></response> |
SMS
<?php
require_once("api_v2/Sms.php");
$sms = new Sms;
?>
private APICredential _apiCredential = new APICredential("username","password","privkey");
private SMS _sms = new SMS(_apiCredential);
The SMS
class gives you access to methods that control messaging
listAvailableDids [GET] [SMS]
List all available sms dids
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XGET https://api2.questblue.com/sms
<?php
//Require the neccesary class once
require_once("api_v2/Sms.php");
//Create a new instance of the class
$sms = new Sms;
//Grab the response and store it for later use
$response = $sms->listAvailableDids();
//Print the response to the screen
print($response);
?>
string result = _sms.ListAvailableDids();
Console.WriteLine(result);
Output: {"total":2,"data":[{"did":xxxxxxxxxxxxx,"sms_enabled":"off","sms_mode":"SMS Disabled"},{"did":xxxxxxxxx,"sms_enabled":"on","sms_mode":"Post SMS to URL","post2url":"
"}]}
List of supported SMS DIDs
Request Method and URL: GET https://api2.questblue.com/sms
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
did | DID to retrieve info. The method supports Unix style DID searching | Optional | (int |
per_page | Number of records to list on a page | Optional | (int)Default 25 |
page | Page number to retrieve data from | Optional | (int) |
Response:
JSON | XML |
---|---|
Success: {"total":10, "total_pages":2, "current_page":1, "data":[{ "did":"5876006899", "sms_enabled":"on", "sms_mode":"Email and XMPP", "email2forward":"john"}…. ]} | Success: <response><total>1</total><total_pages>2</total_pages><current_page>1</current_page><data><row0><did>5876006899</did><sms_enabled>on</sms_enabled><sms_mode>Email and XMPP</sms_mode><email2forward>john@doe.com</email2forward></row0></data></response> |
updateSmsConfig [PUT] [SMS]
Update config and change post2url to example.com
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPUT https://api2.questblue.com/sms -d "{\"did\": 3332224444, \"sms_mode\": \"url\", \"post2url\": \"http://example.com\", \"post2urlmethod\": \"form\"}"
<?php
//Require the neccesary class once
require_once("api_v2/Sms.php");
//Create a new instance of the class
$sms = new Sms;
//Grab the response and store it for later use
$response = $sms->updateSmsConfig("1112223333","url",null,null,null,"http://example.com","form");
//Print the response to the screen
print($response);
?>
SmsConfig smsConfig = new SmsConfig()
{
did = "1112223333",
sms_mode = "url",
post2url = "https://example.com"
};
string result = _sms.UpdateSmsConfig(smsConfig);
Console.WriteLine(result);
Output: n/a
Set SMS availability and SMS settings
Request Method and URL: PUT https://api2.questblue.com/sms
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
did | DID to manage | Required | (int) |
sms_mode | Set SMS mode | Required | (string)email – Inbound SMS will be forwarded to Email. url – SMS will be posted to. chat - SMS will be used with wetext.pro service. |
forward2email | Email address to forward inbound sms | Required if sms_mode is set to email or both | (string) |
post2url | SMS will be sent to the specified URL on your server Following POST variables will be send: from - TN SMS message was sent from to - TN(from your account) SMS message was delivered to msg- SMS message body | Required if sms_mode is set to url | (string) |
post2urlmethod | URL posting method | Required if sms_mode is set to url | (string)form,json,xml |
chat_email | Email address to associate with WeText account | Required if sms_mode is set to chat | (string) |
chat_passwd | Password to login to WeText account | Required if sms_mode is set to chat | (string) |
Response:
JSON | XML |
---|---|
Success: empty | Success: empty |
Warning (Non Critical Error):{"warning":["Warning Message"]} | Warning (Non Critical Error): <response><warning><row0>Warning Message</row0></warning></response> |
Error: {"error":"Error message"} | Error: <response><error>Error message</error></response> |
sendMsg [POST] [SMS]
Send a message with a picture
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XPOST https://api2.questblue.com/smsv2 -d "{\"did\":\"11122233333\",\"did_to\":[\"2223334444\"],\"msg\":\"test\",\"file_url\": ['https://somepicture.com/image.png']}"
<?php
//Require the neccesary class once
require_once("api_v2/Sms.php");
//Create a new instance of the class
$sms = new Sms;
$media = array(
"https://somepicture.com/image.png",
"https://somepicture.com/image2.png"
);
//Grab the response and store it for later use
$response = $sms->sendMsg("1112223333","2223334444","Hello from PHP!",$media);
//Print the response to the screen
print($response);
?>
string result = _sms.SendSMS("1112223333",
new string[] {"2223334444"},
"Hello from C#!",
new string[]{"https://somepicture.com/image.png","https://somepicture.com/image2.png"});
Console.WriteLine(result);
Output: {"data":{"msg_id": 1110000222}}
Send SMS or MMS message to US based TN
Request Method and URL: POST https://api2.questblue.com/smsv2
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
did | DID to send message. Must be active SMS enabled DID | Required | (string) |
did_to | US based DID to send message to | Required | (array) |
msg | Text message to be sent | Required | (string) |
file_url | String array of media files to be sent | Optional | (array) |
Response:
JSON | XML |
---|---|
Success: {"data":{"msg_id": 1110000222}} | Success: empty |
Error: {"error":"Error Message"} | Error: <response><error>Error Message</error></response> |
Receive Messsage [POST] [SMS]
Handle receive message callback
string from
string[] to
string text
string[] media
string segments
string type
<?php
$json = file_get_contents('php://input');
$json_data = json_decode($json,true);
$from = $json_data['from'];
$to = $json_data['to'];
$text = $json_data['text'];
$media = $json_data['media'];
$segments = $json_data['segments'];
$type = $json_data['type'];
//Do something with the variables
?>
n/a
from: Number that sent the message
to: Array of numbers the message was sent to
text: The text that was sent
media: Array of media urls
segments: The amount of segments the message was split into
type: The type of message SMS/MMS
Status Callback [POST] [SMS]
Handle status callback
string reference_id
string from
string to
string status
string reason
string segments
<?php
$json = file_get_contents('php://input');
$json_data = json_decode($json,true);
$reference_id = $json_data['reference_id'];
$from = $json_data['from'];
$to = $json_data['to'];
$status = $json_data['status'];
$reason = $json_data['reason'];
$segments = $json_data['segments'];
//Do something with the variables
?>
n/a
Since Messaging V2 we automatically send a status callback to your endpoint once a message is delivered.
Note: For group messaging you will receive a status response for each individual number in the group message
From: Number that sent the message
To: Number the message was delivered to
Status: Status of the message (delivered/failed)
Reason: Reason the message was not delivered(Message was not delivered due to spam)
Segments: The amount of segments the message was split into
checkDeliveryStatus [GET] [SMS]
Retrieve Message Delivery Status
curl -i -u <api_username>:<api_password> -H "Content-type: application/json" -H "Security-Key: <your_private_key>" -XGET https://api2.questblue.com/sms/deliverystatus -d -d "{\"msg_id\":1110000222}"
<?php
//Require the neccesary class once
require_once("api_v2/Sms.php");
//Create a new instance of the class
$sms = new Sms;
//Send a message and store the response
$response = $sms->sendMsg("3332224444","1112223333","This is just a test message");
//Turn json response back into a php object
$response_object = json_decode($response);
//Get message id
$msg_id = $response_object["msg_id"];
//Get the delivery status
$response = $sms->checkDeliveryStatus($msg_id);
//Print the response to the screen
print($response);
?>
string result = _sms.CheckDeliveryStatus("112233");
Console.WriteLine(result);
Output: {"data":{"status":"sent"}}
Retrieve Message Delivery Status
Request Method and URL: GET https://api2.questblue.com/smsv2/deliverystatus
Params to Send:
Parameter | Description | Mandatory | Values |
---|---|---|---|
msg_id | Sent message ID to check status | Required | (int) |
Response:
JSON | XML |
---|---|
Success: {"data":{"status":"sent"}} | Success: empty |
Error: {"error":"Error Message"} | Error: <response><error>Error Message</error></response> |