Retrieve a list of faxes queued

POST Variables

 

Variable Name Type Var Type Description
action String Required Must be “Get_Faxes_Queued”
access_id Integer Required Account Number
access_pwd String Required Password on the user’s account
sResponseFormat String Optional “XML” or “JSON” – Default is JSON
sIncludeSubUsers String Optional Set to “Y” if you want to include faxes received by a sub user of the account as well

 

Notes:

  • If you want to use sIncludeSubUsers, you will need to use the access_id and access_pwd of the Master Account

 

 

Returned Variables (JSON or XML Encoded)

 

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

Array[#]->array(
  FaxDetailsID   => Integer,
  FileName       => String(75), 
  Status         => String(15), 
  DateQueued     => String,
  ToFaxNumber    => String(20),
  EpochTime      => String,
  Subject        => String(128),
  RefNum         => String(20),
  Pages          => Integer, 
  Size           => Integer,
  User_FaxNumber => String(20),
  SubmittedFiles => String,
)

If sIncludeSubUsers is set to “Y” then one additional variables are returned in the array:

User_ID         => Integer
Note: If an error is found then the reason for the failure will be in the Result string

 

Notes:

  • Both Date and Epoch Time are adjusted to your date/timezone settings
  • Epoch Time is a unix time stamp of the Date field
    • https://en.wikipedia.org/wiki/Unix_time

 

 

Examples

PHP using cURL

  1. <?php
  2. $postVariables = array(
  3. ‘action’ => Get_Faxes_Queued,
  4. ‘access_id’ => ‘12345’,
  5. ‘access_pwd’ => ‘myPassword’,
  6. ‘sSubUserID’ => ‘Y’
  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_Faxes_Queued(array(
  9. ‘sSubUserID’ => ‘Y’
  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. ?>