Java Fax - Cancel outbound faxes in process

This is a Java code sample to show how to retrieve the list of all faxes submitted and cancel those faxes that are still in process. This code sample is based on the Java library for InterFAX available on Github.

This sample demonstrates how to retrieve all of the faxes submitted to InterFAX and then looping through all faxes and checking the status of each fax -- if the status of the fax is < 0 (i.e. still in process), the sample shows how to submit a request to cancel this fax.

  
     // get all recent faxes
OutboundFaxStructure[] faxes
  = interfax.getFaxList();

// cancel all processing faxes
for (OutboundFaxStructure fax : faxes) {
    if (fax.getStatus() < 0) {
    interfax.cancelFax(fax.getId());
    }
}

  

Please note, once a fax has been cancelled, the fax will be marked with a special status code and no further attempts will be made on this fax.

Contact us today

Talk to a member of our team about the benefits InterFAX can bring to your organization's communications processes.

Contact us today