Deletes a specified queued fax which has not been processed

POST Variables

 

Variable Name Var Type Type Description
action String Required Must be “Stop_Fax”
access_id Integer Required Account Number
access_pwd String Required Password on the user’s account
sFaxDetailsID Integer Require* 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 See below for possible values
Note: If an error is found then the reason for the failure will be in the Result string

 

This function is used for removing a fax from the queue once it has been scheduled. Please note that depending on where the fax is in the process, it is possible to have some pages sent by the time the fax is stopped.

 

 

Possible results are:

 

Status = Success:

  • Result:
    • “Fax cancelled but partially sent” – fax was successfully cancelled but
      whatever was in the fax buffer will have been sent.
    • “Fax Cancelled” – the fax was successfully cancelled without any pages being
      sent.

 

Status = Failed

  • Result:
    • “Fax transmission completed” – the fax has been sent and the transaction is
      complete
    • “Unable to Cancel Fax” – Fax in the process of conversion and cannot be
      cancelled at this time – you can try again in 10 seconds.
    • “File not found – Please try again” – Fax could not be found at this time – you can try again in 5 seconds.

 

 

Examples

PHP using cURL

  1. <?php
  2.    $postVariables = array(
  3.      ‘action’           => ‘Stop_Fax’,
  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->Stop_Fax(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.  ?>