POSTS
PORTFOLIO
SEARCH
SHOP
  • Your Cart Is Empty!
Your address will show here +12 34 56 78
API command for developers
Looking for telecom solutions without needing a developer? Our user portal has you covered! 
  • Text Hover
Ordering Available Fax DIDs and Rate Centers
To order a fax DID you will need to have the state, the state code, and know the available DIDs using this info.
Much like regular DIDs you will use the commands faxListStates(), faxListRateCenters("stateCode"), and faxListAvailableDids("rateCenter","stateCode").
$api->faxListStates();
$api->faxListRateCenters("CT");
$api->faxListAvailableDids("BYRAM","CT");
$api->faxListAvailableDids($api-> faxListRatecenters($api-> faxListStates()-> states[7])-> ratecenters[4],"CT");
You can use these commands together in order to order a fax DID.
EXAMPLE:
<?php
$api = new QBapi();
$result = $api->faxOrderDid($api->faxListAvailableDids($api-> faxListRatecenters($api-> faxListStates()-> states[7])-> ratecenters[4],"CT")-> dids[0]);
$result = $api->orderLnp($params,$file);
echo '<pre>';
print_r($result);
?>

You will receive:

[result] => success
[fax_id] => 564743

This fax_id can be used to search using the faxHistory() function.
Fax DID settings and manipulation
You can set a note in the did using the setFaxDidNote() function.
It takes two parameters, the DID and the note to be passed in
setFaxDidNote("XXXXXXXXXX","for testing");
Use faxListDids(), a command with no parameters, to list iFax assigned DIDs.
faxListDids();
Removing a DID is done with the faxRemoveDid() function removes a did. This takes in the DID number as the only parameter.
faxRemoveDid("XXXXXXXXXX");
Setting up an authorized iFax email for outbound and inbound email is done with the faxAuthEmail() command. This takes 3 parameters:
    DID: the fax DID
    auth_email: email(s) allowed to send outbound. This can be multiple as long as they are seperated by a comma
    forw_email: email(s) allowed to forward inbound. This can be multiple as long as they are seperated by a comma
EXAMPLE:
<?php
$api = new QBapi();
$result = $api->faxAuthEmail("XXXXXXXXXX","XYZ@gmail.com , XYZ@questblue.com" , "XYZ@gmail.com , XYZ@questblue.com");
echo '<pre>';
print_r($result);
?>
Will output
[result] => success
[auth_email] => XYZ@gmail.com,XYZ@questblue.com
[forw_email] => XYZ@gmail.com,XYZ@questblue.com
You can retrieve the fax history from any DID or from all DIDs under your account from defined or undefined periods of time using the faxHistory() function.
It takes three to four parameters:
    DID(string or array): your iFax DID, DIDs or left blank to retrieve all of them
    period: what period of time you want to see records for
        0 (default): today
        1: yesterday
        An array: start / end ('2018-04-25 21:00:00','2018-04-25 22:24:58)
    type: inbound or outbound
        0 (default): all directions
        1: inbound faxes
        2: outbound faxes
   Fax ID: This is returned by the faxSend() function
EXAMPLE (no fax ID):
<?php
$api = new QBapi();
$period = array("2018-01-01 21:00:00","2018-06-06 15:00:00");
$result = $api->faxHistory("XXXXXXXXXX",$period,0);
echo '<pre>';
print_r($result);
?>
EXAMPLE (with fax ID):
<?php
$api = new QBapi();
$period = array("2018-01-01 21:00:00","2018-06-06 15:00:00");
$result = $api->faxHistory("XXXXXXXXXX",$period,0,"XXXXXX");
echo '<pre>';
print_r($result);
?>
Where "XXXXXX" is the Fax ID returned by the faxSend() function.
This will return:
[faxhistory] => SimpleXMLElement Object
    [send_time] => 18-07-13 14:00:07
    [fax_id] => 581597
    [did_from] => 9192308712
    [did_to] => 7204657730
    [fax_type] => outbound
    [status] => sent
Sending a fax
The faxSend() command is the function used for sending faxes. It takes 4 parameters:
    didfrom: the DID that is being used
    didto: the target number for the fax
    name: the intended recipient
    filePath: the file path of the document you're sending
The only file types that are accepted: .jpg, .pdf, .ps, .tif, .tiff, .doc, .docx, .xls, .cvs, .htm, .html, .txt EXAMPLE:
<?php
$api = new QBapi();
$result = $api->faxSend("XXXXXXXXXX","XXXXXXXXXX","John Smith","/home/Documents/records/SMITH.pdf");
echo '<pre>';
print_r($result);
?>
Deleting a Fax user and Fax DID
When deleting a fax DID it is a good idea to delete the user log in before you delete the DID.
The commands to do this are the faxDeleteUser() command and the faxRemoveDid() function. EXAMPLE:
<?php
$api = new QBapi();
$result = $api->faxDeleteUser("USERNAME");
$result = $api->faxRemoveDid("XXXXXXXXXX");
echo '<pre>';
print_r($result);
?>