Dark Mode

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 the download pages to grab the SDK for the language you will be using. PHP or C#

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.
  • JSON data exchange format provides an easy to use format 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

To get started, choose the SDK for the language you will be using. PHP or C#

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)

<?php
//Setup your credentials in the Connect class:
//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
?>
<?php
//List the available states sample code
//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);
?>
Account

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


<?php
require_once("api_v2/Account.php");

$account = new Account;
?>
private APICredential _apiCredential = new APICredential("username","password","privkey");
private Account _account = new Account(_apiCredential);

getAccountBalance [GET]

If available, get account balance and allowed credit

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

Params to send:

none
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);
Response:
Success: {"data":  {"balance":"99.00",  "allowed_credit":"110.00"} } (HTTP Code: 200)

setAutorefill [PUT]

Enable or disable automatic account autorefill

Request Method and URL: PUT https://api2.questblue.com/account/setautorefill

Params to send:

autorefill
Required: Yes
Values: (string) on/off
Description: Enable or Disable
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);
Response:
Success: empty
Error: {"error":"Error Message"}

setBalanceReload [PUT]

Configure minimum account balance and autorefill values

Request Method and URL: PUT https://api2.questblue.com/account/setbalancereload

Params to send:

min_balance
Required: Yes
Values: (int) 5, 25, 30, 35, 40, 45, 50, 100
Description: Minimum account balance
reload_amount
Required: Yes
Values: (int) 25, 50, 60, 70, 80, 90, 100, 200, 300, 400, 500, 1000, 15000, 2000, 2500
Description: Autorefill balance ammount
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);
}
Response:
Success: empty
Error: {"error":"Error Message"}

refillBalance [PUT]

Refill account balance

Request Method and URL: PUT https://api2.questblue.com/account/refillbalance

Params to send:

amount
Required: Yes
Values: (int) Minimum value 10(USD)
Description: Amount to add to balance
mode
Required: No
Values: (string) cc - Charge Credit/Debit, ach - ACH payment, all - CC + ACH
Description: Payment processing mode
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);
Response:
Success: empty
Error: {"error":"Error Message"}

getRates [GET]

List the service rates

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

Params to send:

none
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);
Response:
Success: {"data": {  "local_did_cost":"1.00",  "inbound_call_rate":"0.01",  "vps_server_rate":"24.00",  "ccrf":"18.80" }}

countryList [GET]

List available countries list for international calls

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

Params to send:

none
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);
Response:
Success: {"data" [  {  "country_id":2689,  "country_name":"AFGHANISTAN"  },  ….  {  "country_id":2919,  "country_name":"ZIMBABWE"  } ]}

countryRate [GET]

List the service rates

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

Params to send:

country_id
Required: Yes
Values: (int) Any numerical country code
Description: Country ID
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);
Response:
Success: {"data": { "local_did_cost":"1.00", "inbound_call_rate":"0.01", "vps_server_rate":"24.00", "ccrf":"18.80" }}
Error: {"error":"Error Message"}

interRatesZone2 [GET]

Lists international call rates for Zone 2

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

Params to send:

none
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);
Response:
Success: {"data":[ { "destination":"American Samoa", "code":"1684", "rate":"0.1188" } ]}
Error: {"error":"Error Message"}
TNs (DIDs)

The Dids class gives you access to methods that control TNs in your DID inventory from ordering, updating, deleting and much more.

<?php
require_once("api_v2/Dids.php");

$dids = new Dids;
?>
string result = _account.InterRatesZone2();

Console.WriteLine(result);

listStates [GET]

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
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);
Response:
Success: {"total":52, "data":["AA", … "WY"]}

listRateCenters [GET]

List of rate centers for a state

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

Params to send:

state
Required: Yes
Values: (string) NC, SC
Description: Standard State abbreviation
tier
Required: Yes
Values: (string) 0(no TF), 1, 1b(SMS avalable), 2(No TF DIDs available)
Description: TN Tier level
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);
Response:
Success: {"total":321, "data":{"ACME":"ACME","ZEBULON":"ZEBULON"}}

listAvailableDids [GET]

Get List of available DIDs - Local or Toll Free

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

Params to send:

type
Required: Yes
Values: (string)local(by default)/tf(toll free)
Description: Type of TN (TF or Local) TF is not available for Tiers 0 and 2
tier
Required: Yes
Values: (string)1/1b/2/3
Description: Tier of TN to order. 0 (Has no TF available), 1 and 1b (Support SMS and have TF), 2 (no TF DIDs available) and 3 (No TF DIDs available)
state
Required: No
Values: (string)Two char state code, i.e. North Carolina = NC
Description: For Local TNs if no NPA is entered
ratecenter
Required: No
Values: (string)For Local DIDs only
Description: For Local TNs if no NPA entered
zip
Required: No
Values: (int) 5 Digits
Description: Optional. 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.
npa
Required: No
Values: (int) 3 digits
Description: Optional. 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
code
Required: No
Values: (int) two digits
Description: Toll Free code. For TF DIDs only.
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\": \"local\",\"tier\":\"1b\",\"state\":\"NC\"}"
<?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);
Response:
Output: {"total":20, "data":["9194911061".............."9196989685"]}

orderDid [POST]

Order Local or Toll Free DID

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

Params to send:

tier
Required: Yes
Values: (string) 0/1/1b/2
Description: Tier of TN to order: 0 (0 has no TF DIDs available), 1, 1b (1 and 1b support SMS and have TF available), 2 (no TF DIDs available)
did
Required: Yes
Values: (int) 10 digits or (array) [2222222222, 3333333333, ...]
Description: Tn(s) to order
route2trunk
Required: No
Values: (string) myTrunk
Description: SIP trunk to route the DID to. The trunk must be active.
cnam
Required: No
Values: (string) on/off/empty
Description: Enable/disable CNAM services
note
Required: No
Values: (string) my DID note here
Description: TN note
pin
Required: No
Values: (int) 1235
Description: Port out security PIN code between 4 to 6 digits. Set an empty value to remove the PIN
lidb
Required: No
Values: (string) 4 to 15 chars (set to empty string to remove)
Description: Set the CallerID name for the TN from 4 to 15 characters in length. (A-Z 0-9)
e911
Required: No
Values: (array)/(string) see E911 parameters and values table below
Description: See E911 parameters and values table below
dlda
Required: No
Values: (array)/(string) See DLDA section below or set to empty to remove.
Description: See DLDA section below or set to empty to remove.
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 "{\"did\": \"5876007262\",\"tier\":\"1b\"}"
<?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);
Response:
Success: empty
Warning (Non Critical Error): {"warning":["Warning Message"]}
Error: {"error":"Error Message"}

listDids [GET]

List Ordered DIDs and thier configurations

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

Params to send:

did
Required: No
Values: (string) minimum 3 digits, 123..., 123*
Description: DID to retrieve info. This method supports Unix style DID searching. You have to use at least three digits, otherwise the search pattern will be ignored. See following examples to understand the search method: *890 - This will find all DIDs ending with 890 i.e. 1234567890. 123* - This will find all DIDs starting with 123 i.e. 1234567890, *456* - This will find all DIDs containing 456 in it i.e. 1234567890
per_page
Required: No
Values: (int) 5-200
Description: Number of records to list in a page. Default value is 25. Set value in the range of 5 to 200 if needed.
page
Required: No
Values: (int)
Description: Page number to retrieve data from
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\": \"9192138311\",\"per_page\":\"50\"}"
<?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);
Response:
Success: {"total":9, "total_pages":9, "current_page":1, "data":[{ "did":"9192138311", "status":"active", "tier":"1b", "type":"local", "note":"", "route2trunk":"", "lidb":"", "cnam":"", "e911":"", "failover":”” }] }

updateDid [PUT]

Manage Active DID Configuration and Settings

Request Method and URL: PUT https://api2.questblue.com/did

Params to send:

did
Required: Yes
Values: (int) 10 digits/(array) [2222222222, 3333333333, ...]
Description: Tn(s) to order
note
Required: No
Values: (string) my note here
Description: TN note
pin
Required: No
Values: (int) 1235
Description: Port out security PIN code
rout2trunk
Required: Yes
Values: (string) myTrunk
Description: SIP trunk to route the DID to. The trunk must be active.
lidb
Required: No
Values: (string) 4 to 15 chars (set to empty string to remove)
Description: Set the CallerID name for the TN
cnam
Required: No
Values: (string) on/off
Description: Enable/disable CNAM services
e911
Required: No
Values: (array)/(string) See E911 section below or set to empty to remove.
Description: See E911 section below or set to empty to remove.
dlda
Required: No
Values: (array)/(string) See DLDA section below or set to empty to remove.
Description: See DLDA section below or set to empty to remove.
e911_call_alert
Required: No
Values: (array)/(string) See e911_call_alert section below or set to empty to remove.
Description: See e911_call_alert section below or set to empty to remove.
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\": \"5876007262\", \"pin\": \"2233\", \"dlda\": \"{"dlda_type": "business", "dlda_name": "QuestBlue", .......}\" }"
<?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);
Response:
Success: empty
Warning (Non Critical Error): {"warning":["Warning Message"]}
Error: {"error":"Error Message"}

deleteDid [DELETE]

Completely Remove DID from Inventory

Request Method and URL: DELETE https://api2.questblue.com/did

Params to send:

did
Required: Yes
Values: (int)
Description: TN to delete
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);
Response:
Success: empty
Error: {"error":"DID Ordering Error"}

move2fax [PUT]

Move voice DID to Fax Inventory

Request Method and URL: PUT https://api2.questblue.com/did/move2fax

Params to send:

did
Required: Yes
Values: (int)
Description: TN to move to fax
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);
?>
n/a
Response:
Success: empty
Error: {"error":"Error message"}

E911 Array Formatting

Not a call, but a reference for formatting E911 option arrays.

Set e911 value to no (empty) to remove E911.

Params to send:

e911_name
Required: Yes
Values: (string)
Description: Name of the person or business registering for 911
e911_city
Required: Yes
Values: (string)
Description: City of the registered 911 customer
e911_state
Required: Yes
Values: (string)
Description: State of registered 911 customer
e911_zip
Required: Yes
Values: (string)
Description: Zip code of registered 911 customer
e911_address
Required: Yes
Values: (string)
Description: Address of the registered 911 customer
e911_unittype
Required: No
Values: (string) It will be ignored if unit number has not been entered
Description: Type of unit customer lives in. Values example: unit, suite, apt number, etc.
e911_unitnumber
Required: No
Values: (string) It will be ignored if unit number has not been entered
Description: Unit number or letter of customer premise.
n/a
n/a
n/a
Response:
n/a

DLDA Array Formatting

Not a call, but a reference for formatting DLDA option arrays.

The Request will take up to three business days to process. Set dlda value to no to unset.

Params to send:

dlda_type
Required: Yes
Values: (string) business, residential
Description: Directory Listing type.
dlda_name
Required: Yes
Values: (string) first name or company name dependent on dlda_type
Description: Business name or Person first name depending on the dlda_type value
dlda_lastname
Required: No
Values: (string) last name
Description: Person last name. Only required if dlda_type is Residential
dlda_streetnum
Required: Yes
Values: (string)
Description: Company or Residential Address Street number
dlda_streetname
Required: Yes
Values: (string)
Description: Company or Residential Address Street name
dlda_city
Required: Yes
Values: (string)
Description: Company or Residential Address City
dlda_state
Required: Yes
Values: (string)
Description: Company or Residential Address State using the 2 letter abbreviation e.g. North Carolina would be NC
dlda_zip
Required: Yes
Values: (string)
Description: Company or Residential Address ZIP code
dlda_email
Required: Yes
Values: (string)
Description: Company or Residential Contact Email
dlda_phone
Required: Yes
Values: (string)
Description: Company or Residential Contact phone number
n/a
n/a
n/a
Response:
n/a

E911 Call Alert Array Formatting

Manage 911 call notification option arrays.

Setting this filed to no (or empty) will unset 911 call alert

Params to send:

email
Required: No
Values: (string)
Description: Email address to send alert to.
sms
Required: No
Values: (string)
Description: Ten digit US based TN to send alert as SMS message to.
n/a
n/a
n/a
Response:
n/a
iFax Enterprise

The Ifax class gives you access to methods that control TNs in your fax inventory from ordering,updating,deleting and much more.

<?php
require_once("api_v2/Ifaxs.php");

$dids = new Ifaxs;
?>
string result = _account.InterRatesZone2();

Console.WriteLine(result);

listStates [GET]

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
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);
?>
Response:
Success: {"total":52, "data":["AA", … "WY"]}

listRateCenters [GET]

List of Rate Centers for a State

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

Params to send:

state
Required: Yes
Values: (string)
Description: Two char state name NC= North Carolina
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);
?>
Response:
Output: {"total":217,"data":["ACADIA VLY","ACME""ROCKYMT HS","ROSEBUD","RUMSEY","RYCROFT"..........."WILLINGDON","WOKING","WRENTHAM","YOUNGSTOWN"]}

listAvailableDids [GET]

Get list of available Fax DIDs Local or toll free

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

Params to send:

type
Required: Yes
Values: (string)local,tf(toll free),tf is not available for tier 2
Description: TN type to list
state
Required: No
Values: (string)
Description: For local TNs only.Required for Local DIDs if no NPA is entered
ratecenter
Required: No
Values: (string)
Description: For local TNs only.Required for Local DIDs if no NPA is entered
zip
Required: No
Values: (int) 5 digits
Description: For local TNs only.For tier 1b only. If ZIP is set then no NPA,state, or ratecenter is required.
npa
Required: No
Values: (int) 3 digits
Description: For local TNs only.If NPA is set then no state and rate center is required.
code
Required: No
Values: (int) 2 character TF code
Description: For TF TNs only
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);
?>
Response:
Output: {"total":107,"data":["9194108535"..........."9842389679","9842389683","9842389686"]}

orderDid [POST]

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:

did
Required: Yes
Values: (int)
Description: Fax DID to order
sname
Required: Yes
Values: (string)
Description: Group short name to add to the fax number. The group must be created before ordering the DID
note
Required: No
Values: (string)
Description: Fax DID note
pin
Required: No
Values: (int) 4 digits
Description: Port Out Security PIN code.
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);
?>
Response:
Success: empty
Warning (Non Critical Error):{"warning":["Warning Message"]}
Error: {"error":"Error message"}

listDids [GET]

List Ordered DIDs and thier configurations

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

Params to send:

did
Required: No
Values: (string) min 3 chars
Description: Fax DID to retrieve info. Support for Unix style DID searching.
per_page
Required: No
Values: (int)
Description: Number of records to list in a page. The default is 25.
page
Required: No
Values: (int)
Description: Page number to retrieve data from.
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);
?>
Response:
Output: {"total":1,"data":[{"did":9105050412,"status":"active","did_type":"local","sname":"marieifax2"}]}

updateDid [PUT]

Update iFaxEnterprise DID Properties

Request Method and URL: PUT https://api2.questblue.com/fax2

Params to send:

did
Required: Yes
Values: (int)
Description: Fax DID to manage
note
Required: No
Values: (string)
Description: DID note
pin
Required: No
Values: (int) 4 digits
Description: Port Out Security PIN code
sname
Required: No
Values: (string)
Description: Group short name to update. Set an empty value to remove current group(delete Fax account)
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);
?>
Response:
Success: empty

deleteDid [DELETE]

Remove iFax Enterprise DID

Request Method and URL: DELETE https://api2.questblue.com/fax2

Params to send:

did
Required: Yes
Values: (int)
Description: TN to delete
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);
?>
Response:
Success: empty
Warning (Non Critical Error):{"warning":["Warning Message"]}
Error: {"error":"Error message"}

createGroup [POST]

Create iFax Group of users(company)

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

Params to send:

sname
Required: Yes
Values: (stirng) max 24 characters
Description: Group short name
name
Required: Yes
Values: (stirng) max 128 characters
Description: Group name
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);
?>
Response:
Success: empty

listGroups [GET]

List iFax Groups(companies) and thier properties

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

Params to send:

sname
Required: No
Values: (string)
Description: Group short name to show group's information
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);
?>
Response:
Success: {"total":2,  "data":[  {"sname":"shortName1", name":"long Name1"},  {"sname":"shortName1","name":"long Name2"}  ] }

updateGroup [PUT]

Update iFax Groups(companies) amd thier properties

Request Method and URL: PUT https://api2.questblue.com/fax2/group

Params to send:

sname
Required: Yes
Values: (string)
Description: Existing group short name to modify
sname_new
Required: Yes
Values: (string) max 24 chars
Description: New group short name
name_new
Required: Yes
Values: (string) max 128 chars
Description: New group name
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);
?>
Response:
Success: empty
Error: {"error":"Error message"}

deleteGroup [DELETE]

Completely Remove iFax Enterprise Group

Request Method and URL: DELETE https://api2.questblue.com/fax2/group

Params to send:

sname
Required: Yes
Values: (string)
Description: Group short name to remove
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);
?>
Response:
Success: empty
Error: {"error":"Error message"}

createUser [POST]

Create new iFax Enterprise User for iFax Group

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

Params to send:

fax_login
Required: Yes
Values: (string) Max 36 chars
Description: Fax user login
fax_password
Required: Yes
Values: (string) Max 64 chars
Description: Fax user password
sname
Required: Yes
Values: (string)
Description: Group short name to add new user to
fax_name
Required: Yes
Values: (string) Max 48 chars
Description: Fax user first name
fax_lname
Required: No
Values: (string) Max 48 chars
Description: Fax user last name
fax_email
Required: No
Values: (string)
Description: Fax user contact email. Must be a valid email
is_admin
Required: No
Values: (string) on/off(default)
Description: Set the user admin privileges
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);
?>
Response:
Success: empty
Error: {"error":"Error message"}

listUsers [GET]

List existing iFax Enterprise Users

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

Params to send:

sname
Required: No
Values: (string)
Description: Fax group short name to view details
fax_login
Required: No
Values: (string)
Description: Fax user login to view details
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);
?>
Response:
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"}  …. ]}
Error: {"error":"Error message"}

updateUser [PUT]

Manage iFax Enterprise User Properties

Request Method and URL: PUT https://api2.questblue.com/fax2/user

Params to send:

fax_login
Required: Yes
Values: (string)
Description: Fax user login to modify. The user must exist in your inventory
fax_password
Required: No
Values: (string) Max 64 chars
Description: Fax user password
fax_name
Required: No
Values: (string) Max 48 chars
Description: Fax user first name
fax_lname
Required: No
Values: (string)
Description: Fax user last name
fax_email
Required: No
Values: (string)
Description: Fax user contact email. Must be a valid email
is_admin
Required: No
Values: (string) on/off(default)
Description: Set the user admin privileges.
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);
?>
Response:
Success: empty
Error: {"error":"Error message"}

deleteUser [DELETE]

Completely remove iFax Enterprise User

Request Method and URL: DELETE https://api2.questblue.com/fax2/user

Params to send:

fax_login
Required: Yes
Values: (string)
Description: Fax user login to modify. The user must exist in your inventory
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);
?>
Response:
Success: empty
Error: {"error":"Error message"}

updateUserPermissions [POST]

Create or Update iFax Enterprise User Permissions

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

Params to send:

fax_login
Required: Yes
Values: (string)
Description: Fax User Login to manage permissions,The user must exist in your inventory
did
Required: Yes
Values: (int)
Description: Fax DID to manage permissions. Must be active DID.
allow_send
Required: Yes
Values: (string) on/off
Description: Allow fax sending
allow_delete
Required: Yes
Values: (string) on/off
Description: Allow fax deletion
allow_list_in
Required: Yes
Values: (string) on/off
Description: Allow viewing of inbound faxes
list_sent
Required: Yes
Values: (string) on/off
Description: Allow viewing of outbound faxes.
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);
?>
Response:
Success: empty
Error: {"error":"Error message"}

listUserPermissions [GET]

List iFax Enterprise Users Permissions

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

Params to send:

fax_login
Required: No
Values: (string)
Description: Fax user login to show permissions
did
Required: No
Values: int
Description: Fax Enterprise DID to show permissionss
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);
?>
Response:
Success: {"total":1,"data":[{"create_date":"Feb 3, 2020","fax_login":"<fax_username>","did":<fax_did>,"allow_send":"on","allow_delete":"on","allow_list_in":"on","allow_list_out":"on"}]}
Error: {"error":"Error message"}

deleteUserPermissions [DELETE]

Delete iFax Enterprise User Permissions

Request Method and URL: DELETE https://api2.questblue.com/fax2/permit

Params to send:

fax_login
Required: Yes
Values: (string)
Description: Fax user login to delete4 permissions
did
Required: Yes
Values: (int)
Description: Fax Enterprise DID to delete 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);
?>
Response:
Success: empty
Error: {"error":"Error message"}

updateEmailPermissions [POST]

Create or Update iFax Enterprise Email Permissions

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

Params to send:

did
Required: Yes
Values: (int)
Description: Fax Enterprise DID to set email permissions
email
Required: Yes
Values: (string)
Description: Email address to set permissions
allow_send
Required: No
Values: (string)
Description: Allow send faxes
allow_recieve
Required: No
Values: (string)
Description: Allow Receive faxes
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);
?>
Response:
Success: empty
Error: {"error":"Error message"}

listEmailPermissions [POST]

List iFax Enterprise email permissions inventory

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

Params to send:

email
Required: No
Values: (int)
Description: Fax Enterprise DID to list email permissions
email
Required: No
Values: (string)
Description: Email address to 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);
?>
Response:
Success: {"total":10, "total_pages":2, "current_page":1, "data":[  {"sname":"myFaxLogin","did":"3025490877",  "email":"john@doe.com",  "allow_send":"on",  "allow_receive":"on"},  …. ]}
Error: {"error":"Error message"}

deleteEmailPermissions [DELETE]

Delete iFax Enterprise email permissions record

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

Params to send:

did
Required: Yes
Values: (int)
Description: Fax Enterprise DID to delete email permissions
email
Required: Yes
Values: (string)
Description: Email address to 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);
?>
Response:
Success: empty
Error: {"error":"Error message"}

uploadFile [POST]

Upload fax file to fax server

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

Params to send:

file
Required: Yes
Values: (string) Max file size to upload: 5MB
Description: Base 64 encoded file content string
filename
Required: Yes
Values: (string)
Description: Uploaded file name
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);
?>
Response:
Success: {"data":{"fax_id":674944}}
Error: {"error":"Error message"}

sendFax [POST]

Send iFax

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

Params to send:

did_from
Required: Yes
Values: (int) 10 digits
Description: Sender fax number. Must be active DID from your account
did_to
Required: Yes
Values: (int) 10 digits
Description: US based destination fax number
file_id
Required: Yes
Values: (int)
Description: Uploaded File ID
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);
?>
Response:
Success: {"data":{"fax_id":674944}}
Error: {"error":"Error message"}
iFax.pro

The Vfax class gives you access to methods that control TNs in your fax inventory from ordering,updating,deleting and much more.

<?php
require_once("api_v2/Ifaxpro.php");

$dids = new Ifaxpro;
?>

listStates [GET]

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
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);
?>
Response:
Success: {"total":52, "data":["AA", … "WY"]}

listRateCenters [GET]

List of Rate Centers for a State

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

Params to send:

state
Required: Yes
Values: (string) 2 chars
Description: Two character standard state abbreviation North Carolina = NC
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);
?>
Response:
Success: {"total":321, "data":{"ACME":"ACME", ... "ZEBULON":"ZEBULON"}}

listAvailableDids [GET]

Get list of available Fax DIDs Local or toll free

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

Params to send:

type
Required: Yes
Values: (string)local,tf(toll free)
Description: TF is not available for tier 2
state
Required: No
Values: (string)
Description: For local TNs only. Required for Local DIDs if no NPA is entered.
ratecenter
Required: No
Values: (string)
Description: For local TNs only. Required for Local DIDs if no NPA is entered.
zip
Required: No
Values: (int) 5 digits
Description: For local TNs only. For tier 1b only. If ZIP is set then no NPA,state, or ratecenter is required.
npa
Required: No
Values: (int) 3 digits
Description: For local TNs only. If NPA is set then no state and rate center is required.
code
Required: No
Values: (int) 2 digits
Description: For TF TNs only.
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);
?>
Response:
Success: {"total":20", data":["9194911062", … "9196989686"]}

orderDid [POST]

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:

did
Required: Yes
Values: (int)
Description: Fax Tn to order
note
Required: No
Values: (string)
Description: Fax TN note
pin
Required: No
Values: (int) 4 digits
Description: Port out security PIN code
fax_name
Required: Yes
Values: (string)
Description: Fax username
fax_email
Required: Yes
Values: (string)
Description: Fax user email address
fax_login
Required: Yes
Values: (string)
Description: Fax user login
fax_password
Required: Yes
Values: (string)
Description: Fax user password
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);
?>
Response:
Success: empty

listDids [GET]

List Ordered DIDs and thier configurations

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

Params to send:

did
Required: No
Values: (string) Min 3 char
Description: Fax DID to retrieve info. Support for Unix style DID searching.
per_page
Required: No
Values: (int)
Description: Number of records to list in a page. The default is 25
page
Required: No
Values: (int)
Description: Page number to retrieve data from
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);
?>
Response:
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"},…. ]}

updateDid [PUT]

Manage Active Fax DID Configuration and Settings

Request Method and URL: PUT https://api2.questblue.com/fax

Params to send:

did
Required: Yes
Values: (int)
Description: Fax TN to manage
note
Required: No
Values: (string)
Description: TN note
pin
Required: No
Values: (int) min 4 digits
Description: Port out security PIN code
unset_acct
Required: No
Values: (string)
Description: Remove Fax account. This method has a priority of fax name,email,login,password parameters assigned in the same request
fax_name
Required: Yes
Values: (string)
Description: Fax username
fax_email
Required: Yes
Values: (string)
Description: Fax user email address
fax_login
Required: Yes
Values: (string)
Description: Fax user login
fax_password
Required: Yes
Values: (string)
Description: Fax user password
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);
?>
Response:
Success: empty
Warning (Non Critical Error): {"warning":["Warning Message"]}
Error: {"error":"Error message"}

deleteDid [DELETE]

Manage Active Fax DID Configuration and Settings

Request Method and URL: DELETE https://api2.questblue.com/fax

Params to send:

did
Required: Yes
Values: (int)
Description: Fax TN to remove
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);
?>
Response:
Success: empty
Warning (Non Critical Error): {"warning":["Warning Message"]}
Error: {"error":"Error message"}

sendFax [POST]

Send iFax

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

Params to send:

file
Required: Yes
Values: (string) jpeg, jpg, gif, png, tif, tiff, pdf, doc, rtf, ods, xls, csv, ppt, txt, rar, zip, 7z4
Description: Base 64 encoded file content string. Maximum file size to upload 5Mb
filename
Required: Yes
Values: (string)
Description: Uploaded file name
did_from
Required: Yes
Values: (int) active TN from your account
Description: Sender Fax Number
did_to
Required: Yes
Values: (int)
Description: Ten digit US-based Destination Fax Number.
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);
?>
Response:
Success: {"data":{"fax_id":674944}}
Error: {"error":"Error message"}

move2voice [PUT]

Move Fax DID to Voice Inventory

Request Method and URL: PUT https://api2.questblue.com/fax/move2voice

Params to send:

did
Required: Yes
Values: (int)
Description: TN to move
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);
?>
Response:
Success: empty
Error: {"error":"Error message"}
International TNs

The Interdids class gives you access to methods that control international TNs in your inventory from ordering,updating,deleting and much more.

<?php
//Require the neccesary class once
require_once("api_v2/Interdids.php");

//Create a new instance of the class
$interdids = new Interdids;
?>

listCountries [GET]

Get Available Country List

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

Params to send:

none
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);
?>
Response:
Success: {"total":43, "data":[  {"code":"DZ","country":"Algeria"},  ….  {"code":"VN","country":"Vietnam"} ]}

listCities [GET]

Get Available City List

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

Params to send:

country_code
Required: Yes
Values: (string)Two char country code obtained from listCountries
Description: Two letter standard country abbreviation
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);
?>
Response:
Success: {"total":21,  "data":[  "BAHIA BLANCA",  ….  "VILLA MERCEDES" ]}

orderDid [POST]

Order International DID

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

Params to send:

country_code
Required: Yes
Values: (string) Two char country code obtained from listCountries
Description: Two letter standard country abbreviation
city
Required: Yes
Values: (string)
Description: City name obtained from listCities
route2trunk
Required: No
Values: (string)
Description: Route International DID to a SIP trunk. The trunk must be active. Set to empty to unroute the TN
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);
?>
Response:
Success: {"did":2234567891}
Warning: {"did":2234567891," warning":{"forward2did":"Set DID forwarding Error"}}
Error: {"error":"DID Ordering Error"}

listDids [GET]

Get International DIDs List and Properties

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

Params to send:

did
Required: No
Values: (int)
Description: DID to retrieve info from
per_page
Required: No
Values: (int) Default 25, range is 5 to 200
Description: Number of records to list in a page.
page
Required: No
Values: (int)
Description: Page number to retrieve data from
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);
?>
Response:
Success: {"total":17, "total_pages":4, "current_page":1, "data"[  {"did":"582127202550", "country":"Venezuela",  "city":"CARACAS", "status":"active",  "route2trunk":"trunkName"}, ... ]}
Error:  {"error":"No International DIDs Found"}

updateDid [PUT]

Get International DIDs List and Properties

Request Method and URL: PUT https://api2.questblue.com/didinter

Params to send:

did
Required: Yes
Values: (int)
Description: TN to manage
route2trunk
Required: No
Values: (string)
Description: Route International DID to a SIP trunk. The trunk must be active. Set an empty value to unroute the 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);
?>
Response:
Success: empty
Error: {"error":"DID Ordering Error"}

deleteDid [DELETE]

Completely Delete International DID

Request Method and URL: DELETE https://api2.questblue.com/didinter

Params to send:

did
Required: Yes
Values: (int)
Description: TN to delete
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);
?>
Response:
Success: empty
Error: {"error":"DID removal error"}
LNP

The LNP class gives you access to methods that relate to LNP orders

<?php
require_once("api_v2/Lnp.php");

$lnp = new Lnp;
?>
private APICredential _apiCredential = new APICredential("username","password","privkey");

private LNP _lnp = new LNP(_apiCredential);

checkPortability [GET]

Check local number portability for specific TN

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

Params to send:

number2port
Required: Yes
Values: (int)/(array)
Description: US TN to check portability
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);
Response:
Success: {"data":{"foc_days":3}}
Error: {"error":"Error Message"}

createLnp [POST]

Create new local number portability request

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

Params to send:

number2port
Required: Yes
Values: (int)
Description: US based porting TN
provider_name
Required: Yes
Values: (string)Maxx 255 chars
Description: Current server provider name
account_no
Required: Yes
Values: (string)
Description: Server provider account number
authorize_contact
Required: Yes
Values: (string)
Description: Authorized contact
contact_title
Required: Yes
Values: (string)
Description: Contact title
street_name
Required: Yes
Values: (string)Max 100 chars
Description: Street name
street_no
Required: Yes
Values: (string)Max 50 chars
Description: Service street number
city
Required: Yes
Values: (string)Max 100 chars
Description: Service city
state
Required: No
Values: (string)
Description: Service state
zipcode
Required: Yes
Values: (mixed)Max 20 chars
Description: Service zipcode
billing_telephone_no
Required: Yes
Values: (int)Ten chars
Description: US based billing telephone number
bill_file
Required: Yes
Values: (string)GIF, JPG, PNG or PDF file. Size up to 5Mb.
Description: Base64 encoded full path phone bill files (scan, photo).
foc_date
Required: No
Values: (string)Format YYYY-MM-DD
Description: Request FOC date. Is not available when porting mobile DID
activate_time
Required: No
Values: (string)Format HH:00(EST)
Description: Request FOC activation (only 9am-4pm EST available)
did_mode
Required: No
Values: (string)voice,fax,Default voice
Description: Type of DID
partial_port
Required: No
Values: (string)yes,no, Default no
Description: Partial port
extra_services
Required: No
Values: (string)
Description: Additional remaining services. Required if partial_port is set to yes
location
Required: No
Values: (string)business,residential
Description: Service Location
company
Required: No
Values: (string)
Description: Company Name. Required if location is set to business
wireless_no
Required: No
Values: (string)yes,no, Default no
Description: Wireless number type
pincode
Required: No
Values: (int)
Description: Wireless account PIN code. Required if wireless_no is set to yes
ssn
Required: No
Values: (int)
Description: SSN last four digits. Required if wireless_no is set to yes
lidb_list
Required: No
Values: (string)yes,no, Default no
Description: LIDB/Directory listings
dir_prefix
Required: No
Values: (string)None, N, NE, E, SE, S, SW, W, NW. Max. 10 chars
Description: Dir prefix
dir_suffix
Required: No
Values: (string)None, N, NE, E, SE, S, SW, W, NW. Max. 10 chars
Description: Dir suffix
service_unit
Required: No
Values: (string)Max 100 chars
Description: Service suite/unity
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);
Response:
Success: {"data":[  {"id":"12345"  ] }
Warning (Non Critical Error):{"warning":["Warning Message"]}
Error: {"error":"Error message"}

listLnp [GET]

List active local number portability request

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

Params to send:

number2port
Required: No
Values: (int)/(string)
Description: Porting numbers to list properties. The method suppoorts unix style porting number searching
id
Required: No
Values: (int)/(array)
Description: The LNP carrier ID
per_page
Required: No
Values: (int) range 1 to 200 default of 10
Description: Number of records to show per page.
page
Required: No
Values: (int)
Description: Page to show
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);
Response:
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"},  ….  ] }

updateLnp [PUT]

Update an existing local number portability request

Request Method and URL: PUT https://api2.questblue.com/lnp

Params to send:

id
Required: Yes
Values: (int)
Description: id of LNP request
trunk
Required: No
Values: (string) or "no" to unset
Description: SIP trunk name to route DID on porting complete(For voice dids Only)
provider_name
Required: No
Values: (string)Maxx 255 chars
Description: Current server provider name
account_no
Required: No
Values: (string)
Description: Server provider account number
authorize_contact
Required: No
Values: (string)
Description: Authorized contact
contact_title
Required: No
Values: (string)
Description: Contact title
street_name
Required: No
Values: (string)Max 100 chars
Description: Street name
street_no
Required: No
Values: (string)Max 50 chars
Description: Service street number
city
Required: No
Values: (string)Max 100 chars
Description: Service city
state
Required: No
Values: (string)
Description: Service state
zipcode
Required: No
Values: (mixed)Max 20 chars
Description: Service zipcode
billing_telephone_no
Required: No
Values: (int)Ten chars
Description: US based billing telephone number
bill_file
Required: No
Values: (string)GIF, JPG, PNG or PDF file. Size up to 5Mb.
Description: Base64 encoded full path phone bill files (scan, photo).
foc_date
Required: No
Values: (string)Format YYYY-MM-DD
Description: Request FOC date. Is not available when porting mobile DID
activate_time
Required: No
Values: (string)Format HH:00(EST)
Description: Request FOC activation (only 9am-4pm EST available)
did_mode
Required: No
Values: (string)voice,fax,Default voice
Description: Type of DID
partial_port
Required: No
Values: (string)yes,no, Default no
Description: Partial port
extra_services
Required: No
Values: (string)
Description: Additional remaining services. Required if partial_port is set to yes
location
Required: No
Values: (string)business,residential
Description: Service Location
company
Required: No
Values: (string)
Description: Company Name. Required if location is set to business
wireless_no
Required: No
Values: (string)yes,no, Default no
Description: Wireless number type
pincode
Required: No
Values: (int)
Description: Wireless account PIN code. Required if wireless_no is set to yes
ssn
Required: No
Values: (int)
Description: SSN last four digits. Required if wireless_no is set to yes
lidb_list
Required: No
Values: (string)yes,no, Default no
Description: LIDB/Directory listings
dir_prefix
Required: No
Values: (string)None, N, NE, E, SE, S, SW, W, NW. Max. 10 chars
Description: Dir prefix
dir_suffix
Required: No
Values: (string)None, N, NE, E, SE, S, SW, W, NW. Max. 10 chars
Description: Dir suffix
service_unit
Required: No
Values: (string)Max 100 chars
Description: Service suite/unity
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);
Response:
Success: empty
Warning (Non Critical Error):{"warning":["Warning Message"]}
Error: {"error":"Error message"}

deleteLnp [DELETE]

Remove Active Local Number Portability Request

Request Method and URL: DELETE https://api2.questblue.com/lnp

Params to send:

id
Required: Yes
Values: (int)
Description: The LNP order ID to cancel
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);
Response:
Success: empty
Warning (Non Critical Error):{"warning":["Warning Message"]}
Error: {"error":"Error message"}
Reports

The Reports class gives you access to methods that retrieve data on for specific services

<?php
require_once("api_v2/Reports.php");

$reports = new Reports;
?>
private APICredential _apiCredential = new APICredential("username","password","privkey");

private Reports _reports = new Reports(_apiCredential);

callHistory [GET]

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:

trunk
Required: No
Values: (string)
Description: SIP Trunk name to retrieve calls.
period
Required: No
Values: (mixed)
Description: Date options to see history. )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
Required: No
Values: (string) on/off
Description: Show successful calls only
did
Required: No
Values: (int)
Description: Retrieve specific TN history
summary_only
Required: No
Values: (string) on/off
Description: Display call summary only
per_page
Required: No
Values: (int) 5 to 5000 default of 25
Description: Number of records to list in a page
page
Required: No
Values: (int)
Description: Page number to display
type
Required: No
Values: (string)in/out
Description: Call type (direction) required if did is set
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);
Response:
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"}, …. ]}

faxHistory [GET]

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:

did
Required: No
Values: (int)
Description: TN to list fax history
service
Required: No
Values: (string) pro/enterprise
Description: Type of fax to list history- fax pro or fax enterprise
type
Required: No
Values: (string) in,out
Description: List of inbound or outbound faxes
fax_id
Required: No
Values: (string)
Description: List only some specific fax by Fax ID
period
Required: No
Values: (string)
Description: Time rand to list history
per_page
Required: No
Values: (int) 10 to 200, default of 25
Description: Number of records to show per page
page
Required: No
Values: (int)
Description: Page number to show
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);
Response:
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"}, …. ]}
Servers

The Servers class gives you access to methods that allow the ordering, updating, and deleting of servers

require_once("api_v2/Servers.php");

$servers = new Servers;
private APICredential _apiCredential = new APICredential("username","password","privkey");

private Servers _servers = new Servers(_apiCredential);

orderServer [POST]

Regular or QuBe server - order a virtual or dedicated server

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

Params to send:

server_type
Required: Yes
Values: (string) small/medium/large/enterprise
Description: Server type: Regular or QuBe(Graphical interface to asterisk installed) Available values and descriptions: 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
Required: No
Values: (string) max 255 characters
Description: server note
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);
Response:
Success:  {"data":{"server_id":10522}}

listServers [GET]

List inventory and properties of ordered servers

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

Params to send:

server_id
Required: No
Values: (int)/(array)
Description: Server ID display
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);
Response:
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"}  ….  ]}

addIp [PUT]

Add an IP address to list of allowed IPs

Request Method and URL: PUT https://api2.questblue.com/server/addip

Params to send:

server_id
Required: Yes
Values: (int)
Description: Server ID to ADD IP address
ip_adderess
Required: Yes
Values: (string)
Description: IP address to add
note
Required: No
Values: (string) max 64 chars
Description: Note or comment
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);
Response:
Success: empty
Warning (Non Critical Error):{"warning":["Warning Message"]}
Error: {"error":"Error message"}

deleteIp [DELETE]

Remove an IP address from allowed IP list

Request Method and URL: DELETE https://api2.questblue.com/server/deleip

Params to send:

server_id
Required: Yes
Values: (int)
Description: Server ID to remove ip from
ip_address
Required: Yes
Values: (string)
Description: Ip Address to remove from server
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);
Response:
Success: empty
Error: {"error":"Error message"}

deleteServers [DELETE]

Remove server from account

Request Method and URL: DELETE https://api2.questblue.com/server

Params to send:

server_id
Required: Yes
Values: (int)
Description: Server ID to delete
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);
Response:
Success: empty
Error: {"error":"Error message"}
Siptrunks

The Siptrunks class gives you access to methods that allow the creation, updating, and deleting of 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);

createTrunk [POST]

Create new SIP trunk or Registration

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

Params to send:

trunk
Required: Yes
Values: (string) max 15 chars
Description: 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
password
Required: No
Values: (string) min 4 chars, max 48 chars
Description: Alpha numeric only. Password will be assigined automatically if not set here.
ip_address
Required: No
Values: (string)
Description: Required for static trunks if no dynamic host is entered.
dynamic_host
Required: No
Values: (string)
Description: 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. Takes precedence over ip_address.
did
Required: No
Values: (int)
Description: TN to route to the trunk. This must be an active TN not routed to any other trunk.
inter_call
Required: No
Values: (string on/off)
Description: Allow to make international calls. This option must be enabled for your account by a server admin.
inter_limit
Required: No
Values: (int) range 1-1000
Description: Limit daily cost for international calls
failover
Required: No
Values: (array)
Description: Change trunks IP address on experiencing a specific number of timeout errors(failover_num) within a specific time(failover_time). 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
Required: No
Values: (int) set to 0 to remove limit
Description: Limit the maximum number of concurrent channels
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);
Response:
Success: empty
Error: {"error":"Error message"}

listTrunks [GET]

Get properties for one specific trunk, or all trunks

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

Params to send:

trunk
Required: No
Values: (string)/(array)
Description: SIP Trunk name to get. single trunk will display more info then an array
per_page
Required: No
Values: (int) range 5 to 200, default of 25
Description: Number of records to list per page
page
Required: No
Values: (int)
Description: Page number to retrieve data from
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);
Response:
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"  },  …. ]}

updateTrunk [PUT]

Update properties for a specific trunk

Request Method and URL: PUT https://api2.questblue.com/siptrunk

Params to send:

trunk
Required: Yes
Values: (string)
Description: SIP trunk name to manage
password
Required: No
Values: (string)
Description: New SIP trunk password
status
Required: No
Values: (string) on/off
Description: Enable or dissable (lock) SIP trunk
ip_address
Required: No
Values: (string)
Description: Change SIP trunk IP address (for static trunks only)
dynamic_host
Required: No
Values: (string)
Description: Host(domain name) with dynamic IP address. The system will check IP address of the host and automatically update it on changing.
inter_call
Required: No
Values: (string) default = "disabled"
Description: Enable to allow international calls. The option itself must be enabled for your account by server admin
inter_limit
Required: No
Values: (int) range 1 to 1000 (USD)
Description: Limit daily cost for international calls
failover
Required: No
Values: (array)cfb[(int)timeout, (bigint) tn2forward], cft[(int)timeout, (bigint) tn2forward, (int) rings_timeout], cfna[(int)timeout, (bigint) tn2forward]
Description: Forwarding inbound calls on Busy, Timeout, Unavailable conditions.
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);
Response:
Success: empty
Warning (Non Critical Error):{"warning":["Warning Message"]}
Error: {"error":"Error message"}

deleteTrunk [DELETE]

Completely remove specific SIP trunk

Request Method and URL: DELETE https://api2.questblue.com/siptrunk

Params to send:

trunk
Required: Yes
Values: (string)
Description: SIP trunk name to remove
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);
Response:
Success: empty
Warning (Non Critical Error):{"warning":["Warning Message"]}
Error: {"error":"Error message"}
Messaging

The SMS class gives you access to methods that control messaging (including MMS)

<?php
require_once("api_v2/Sms.php");

$sms = new Sms;
?>
private APICredential _apiCredential = new APICredential("username","password","privkey");

private SMS _sms = new SMS(_apiCredential);

listAvailableDids [GET]

List of supported SMS DIDs

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

Params to send:

did
Required: No
Values: (int)/(array)
Description: DID to retrieve info. The method supports Unix style DID searching
per_page
Required: No
Values: (int) default of 25
Description: Number of records to list on a page
page
Required: No
Values: (int)
Description: Page number to retrieve data from
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);
Response:
Success: {"total":10, "total_pages":2, "current_page":1, "data":[{  "did":"5876006899",  "sms_enabled":"on",  "sms_mode":"Email and XMPP",  "email2forward":"john"}…. ]}

updateSmsConfig [PUT]

Set SMS availability and SMS settings

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

Params to send:

did
Required: Yes
Values: (int)
Description: TN to manage
sms_mode
Required: No
Values: (string) email/url/chat
Description: Set Messaging mode. email – Inbound SMS will be forwarded to Email. url – SMS will be posted to. chat - SMS will be used with wetext.pro service.
forward2email
Required: Yes
Values: (string)
Description: Email address to forward inbound messages to. Required if sms_mode is set to email
post2url
Required: No
Values: (string)
Description: 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 set to url
post2urlmethod
Required: No
Values: (string) form,json,xml
Description: URL posting method
chat_email
Required: No
Values: (string)
Description: Email address to associate with WeText account. Required if sms_mode set to chat.
chat_password
Required: No
Values: (string)
Description: Password to login to WeText account. Required if sms_mode set to chat.
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);
Response:
Success: empty
Warning (Non Critical Error):{"warning":["Warning Message"]}
Error: {"error":"Error message"}

sendMsg [POST]

Send SMS or MMS message to US based TN

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

Params to send:

did
Required: Yes
Values: (string)
Description: DID to send message. Must be active SMS enabled DID
did_to
Required: Yes
Values: (array)
Description: US based DID to send message to
msg
Required: Yes
Values: (string)
Description: Text message to be sent
file_url
Required: No
Values: (array)
Description: String array of media files to be sent
<?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);
Response:
Success: {"data":{"msg_id": 1110000222}}
Error: {"error":"Error Message"}

Receive Messsage [POST]

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

Params to send:

none
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
?>
Response:

Status Callback [POST]

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

Params to send:

none
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
?>
Response:

checkDeliveryStatus [GET]

Retrieve Message Delivery Status

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

Params to send:

msg_id
Required: Yes
Values: (int)
Description: Sent message ID to check status of
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);
Response:
Success: {"data":{"status":"sent"}}
Error: {"error":"Error Message"}