NAV Navbar
php

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

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
?>
//Located at Api2->Connect.java lines 34-37
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.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);
?>
package api2;

public class APITesting{
    public static void main(String[] args){
        Dids api = new Dids();
        api.showResponse(api.listStates());
    }
}

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
02/10/2020 2.1 2.1
06/14/2019 2 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

The Account class gives you access to methods that control your account such as getting or setting your account balance

getAccountBalance [GET] [Account]

Get Account Balance Example

<?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);
?>
curl -i -u "<your_username>":"<your_password>" -H"content-type:application/json" -H "Security-Key: <md5hash_of_private_key_and_id>" https://api2.questblue.com/account/getbalance -XGET

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

<?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);
}
?>

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

<?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);
}
?>

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

<?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);
}
?>

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

<?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);
?>

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

<?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);
?>

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

<?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);
?>

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

<?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);
?>

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

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

<?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);
?>
package api2;

public class APITesting{
    public static void main(String[] args){
        Dids api = new Dids();
        api.showResponse(api.listStates());
    }
}

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

<?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);
?>

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)1/1b(SMS enabled)/2

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

<?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);
?>

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

<?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","8448859713");

//Print the response to the screen
print($response);
?>

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)1/1b/2, Two char state name
did Did to order Required (mixed) Integer or Array
route2trunk SIP trunk to route the DID to. The trunk must be active. Optional (string)

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 [POST] [DID]

List all DIDs in account

<?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();

//Print the list to the screen
print($did_list);
?>

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 all DIDs in account that start with "844"

<?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("844*");

//Print the list to the screen
print($did_list);
?>

Output: {"total":11,"data":[{"did":8445735216,"status":"active","tier":"1b","type":"tf","note":"SMS Test","route2trunk":"Brandontest"}......{"did":8448859713,"status":"active","tier":"1b","type":"tf"}]}

List Ordered DIDs and thier configurations

Request Method and URL: POST 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

<?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("8448864948","New note");

//Print the response to the screen
print($response);
?>

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

<?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("8448864948");

//Print the response to the screen
print($response);
?>

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>

IFaxEnterprise

listStates [GET] [IFAXENTERPRISE]

Display list of 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

<?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

<?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

<?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("9842054724","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

<?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

<?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("9199091999");

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

<?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("9193339099");

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

<?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

<?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

<?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

<?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

<?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

<?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

<?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("<fax_username>","<fax_password>","<first_name>","<last_name>","<email>","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

<?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("<fax_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

<?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("<fax_username>","<some_did>","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

<?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("<fax_username>","<fax_did>");

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

<?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("<fax_username>","<fax_did>");

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

<?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("<fax_did>","<fax_email>","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 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

<?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("<fax_did>","<fax_email>");

//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 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 [GET] [IFAXENTERPRISE]

Delete email permissions

<?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("<fax_did>","<fax_email>");

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

<?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

<?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("<fax_did_from>","<fax_did_to>","<uploaded_file_id>");

//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 (array)

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

<?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

<?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

<?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

<?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("9194240145","","","programmer_joe","programmer_joe@example.com","programmer_joe","programmer_joe54321");

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

<?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

<?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("9192301271","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

<?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("9192301271");

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

<?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("<fax_did_from>","<fax_did_to>","/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>

Interdids

listCountries [GET] [INTERDIDS]

Display list of countries

<?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

<?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

<?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

<?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("xxx",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]

Order t1 did

<?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("xxxxx");

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

<?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("xxxx");

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

checkPortability [GET] [LNP]

Check if number is portable

<?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("xxxxxxx");

//Print the response to the screen
print($response);
?>

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

<?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" => [8457898207],
    "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" => "1111111111",
    "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);
?>

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 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

<?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);
?>

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 Sprint

<?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" => '<did>',
    "provider_name" => "Sprint"
);

//Grab the response and store it for later use
$response = $lnp->updateLnp($data);

//Print the response to the screen
print($response);
?>

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
number2port US based porting TN Required (int
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]

//todo

<?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("3364936472");

//Print the response to the screen
print($response);
?>

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
number2port Porting number presented in your current LNP requests dashboard 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

callHistory [GET] [REPORTS]

Get call history from 02/01/2020 to 02/05/2020

<?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,[1580515200,1580860800]);

//Print the response to the screen
print($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 ifax pro history from 02/01/2020 to 02/05/2020

<?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,[1580515200,1580947200]);

//Print the response to the screen
print($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>

downloadFaxFile [GET] [REPORTS]

//todo

//todo

Output: n/a

Download send or received Fax

Request Method and URL: GET https://api2.questblue.com/faxhistory

Params to Send:

Parameter Description Mandatory Values
fax_id Fax ID of file to download Required (int)

Response:

JSON XML
Success: {"data": {"fax_base64":"JVBERYmoKP...0NzUzCiUlRU9GCg=="} } Success: <response><data><fax_base64>vYmoKPD...UzCiUlRU9GCg==</fax_base64></data></response>

Servers

orderServer [POST] [SERVERS]

Order a dedicated server

<?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);
?>

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)dedicated,qubededicated,qubevirtual
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

<?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);
?>

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

<?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);
?>

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

<?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);
?>

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

<?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);
?>

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

createTrunk [POST] [SIPTRUNKS]

Create new 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->createTrunk("testingTrunk","testpass","127.0.0.1");

//Print the response to the screen
print($response);
?>

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

Response:

JSON XML
Success: empty Success: empty
Error: {"error":"Error message"} Error: <response><error>Error message</error></response>

listTrunks [GET] [SIPTRUNKS]

List all trunks

<?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);
?>

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

<?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("testingTrunk","newtestpass");

//Print the response to the screen
print($response);
?>

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]

//todo

//todo

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

listAvailableDids [GET] [SMS]

List all available sms dids ```php <?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); ?> ```

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

<?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("xxxxxxxxxxx","url",null,null,null,"http://example.com");

//Print the response to the screen
print($response);
?>

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. xmpp – Inbound SMS will be delivered to XMPP messenger both – Inbound SMS will be forwarded to Email and delivered to XMPP messenger. url – SMS will be posted to
forward2email Email address to forward inbound sms Required if sms_mode is set to email or both (string)
xmpp_name XMPP Username Required if sms_mode is set to xmpp or both (string)
xmpp_password XMPP Password Required if sms_mode is set to xmpp 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)

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

<?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->sendMsg("<did_from>","<did_to>","This is just a test message","/relative/path/to/image.png");

//Print the response to the screen
print($response);
?>

Output: n/a

Send SMS or MMS message to US based TN

Request Method and URL: POST https://api2.questblue.com/sms

Params to Send:

Parameter Description Mandatory Values
did DID to send message. Must be active SMS enabled DID Required (int)
did_to US based DID to send message to Required (int)
msg Text message to be sent Required (string)
file Base64 encoded file content to send. If file is set then message will be sent as MMS system and executable files aren't permitted Optional (string)
fname Base64 encoded name of file to send Required if file is defined (string)

Response:

JSON XML
Success: empty Success: empty
Error: {"error":"Error message"} Error: <response><error>Error message</error></response>
php