Retrieve the status of a single fax.

POST Variables

 

Variable Name Var Type Type Description
action String Required Must be “Get_FaxStatus”
access_id Integer Required Account Number
access_pwd String Required Password on the user’s account
sFaxDetailsID Integer Required FaxDetailsID returned from Queue_Fax
sResponseFormat String Optional “XML” or “JSON” – Default is JSON

 

Returned Variables (JSON or XML Encoded)

 

Status string “Success” or “Failed”
Result string Array of the fax properties as follows:

array(
  FileName    => String(75), 
  SentStatus  => String(15), 
  DateQueued  => String,
  DateSent    => String,
  EpochTime   => String,
  ToFaxNumber => String(20),
  Pages       => Integer, 
  Duration    => Integer, 
  RemoteID    => Integer, 
  ErrorCode   => String(75), 
  Size        => Integer,
  AccountCode => String,
)
Note: If an error is found then the reason for the failure will be in the Result string

 

Possible Values for “SentStatus”:

  • In Progress
  • Sent
  • Failed
  • Sending Email
    • If you receive a result of “FaxDetailsID Not Found”. This means that the FaxDetailsID provided where not valid or the fax was not queued due to a conversion error. If you feel like you got this message in error, please contact Customer Support

 

The Date

  • Queued and DateSent will reflect your account’s timezone settings
  • EpochTime is a unix time stamp of the DateSent field
    • https://en.wikipedia.org/wiki/Unix_time
  • ErrorCode will be a string describing the error encountered. There is a wide range of possible errors, the most frequent of which are “Busy”, “No Answer”, and “No Remote Fax”.

 

Examples

PHP using cURL

  1. <?php
  2.    $postVariables = array(
  3.      ‘action’         => ‘Get_FaxStatus’,
  4.      ‘access_id’      => ‘12345’,
  5.      ‘access_pwd’     => ‘myPassword’,
  6.      ‘sFaxDetailsID’  => ‘12345678’,
  7.    );
  8.    $curlDefaults = array(
  9.        CURLOPT_POST           => 1,
  10.        CURLOPT_HEADER         => 0,
  11.        CURLOPT_URL            => “https://secure.srfax.com/SRF_SecWebSvc.php”,
  12.        CURLOPT_FRESH_CONNECT  => 1,
  13.        CURLOPT_RETURNTRANSFER => 1,
  14.        CURLOPT_FORBID_REUSE   => 1,
  15.        CURLOPT_TIMEOUT        => 60,
  16.        CURLOPT_SSL_VERIFYPEER => false,
  17.        CURLOPT_SSL_VERIFYHOST => 2,
  18.        CURLOPT_POSTFIELDS     => http_build_query($postVariables),
  19.    );
  20.    $ch = curl_init();
  21.    curl_setopt_array($ch, $curlDefaults);
  22.    $result = curl_exec($ch);
  23.    if (curl_errno($ch)) {
  24.        echo “Error – “ . curl_error($ch);
  25.    }
  26.    else {
  27.        echo “Result:” . print_r( json_decode($result, true), 1 );
  28.    }
  29. ?>

 

PHP using SRFax Object

  1. <?php
  2.   require_once (“srFax_class.php”);
  3.   $accountID        = “12345”;
  4.   $accountPassword  = “myPassword”;
  5.   // instantiate object with Account ID and Password
  6.   $srFax = new srFax ( $accountID, $accountPassword );
  7.   try {
  8.       $srFax->Get_FaxStatus(array(
  9.           ‘sFaxDetailsID’ => ‘12345678’,
  10.       ));
  11.   }
  12.   catch (Exception $e) { //display error when exception is thrown
  13.       die(“Error: $e);
  14.   }
  15.   if ( $srFax->getRequestStatus () ) {
  16.       echo “Success! Response “ . print_r($srFax->getRequestResponse (), 1);
  17.   } else {
  18.       echo “ERROR: “ . $srFax->getRequestResponse ();
  19.   }
  20. ?>