ColdFusion Fax – Cancel Pending Fax

Cancelling a previously-submitted outbound fax with ColdFusion can be done using the CancelFax method.

The following ColdFusion fax snippet cancels a fax and checks if the cancellation was successful.

Using CancelFax with ColdFusion only effects faxes waiting to be sent (with the status codes: -1 Preprocessing, -2 Ready, or -3 Pending Retry), and not faxes that are being actively transmitted.


<!--- Username and password for the Interfax account. --->
<cfset interfaxUsername = "">
<cfset interfaxPassword = "">
<cfset transactionID     = "">

<!--- Create and call the web service --->
<cfset faxWebService = CreateObject("webservice", "")>

<cfset CancelFaxResult = faxWebService.CancelFax(interfaxUsername, interfaxPassword, transactionID)>

<!--- Check to see if cancellation of transaction is successful. --->
<cfif CancelFaxResult eq 0>
    Cancellation of transaction is successful.
    Error cancelling fax.
    Return code: #CancelFaxResult#.<br>
    Error message:  #CancelFaxResult#