Java Fax - Send a fax and check its status

This is a more advanced Java code sample to show how to send a fax and then check the status of a fax that was submitted until the status indicates that the fax has been completed. This code sample is based on the Java library for InterFAX available on Github.

This sample demonstrates how to send a fax with a PDF through InterFAX to a single recipient and then loop through checking the status of that fax until processing of the fax is completed in InterFAX - all you need to do in order to change it is to provide a different fax destination number and a path to a file.
A fax in InterFAX is completed when either the fax was sent successfully to the recipient (in which case, the fax status would be "0") or all of the call attempts for this fax have been completed and the fax was not sent fully (in which case the fax status would be > 0).