Package net.interfax.rest.client
Interface InterFAX
-
- All Known Implementing Classes:
DefaultInterFAXClient
public interface InterFAX
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description APIResponsecancelDocumentUploadSession(String documentId)Cancel a document upload and tear down the upload session, or delete a previous uploadAPIResponsecancelFax(String id)Cancel a fax in progressvoidcloseClient()Close underlying client and free up any held system resourcesDoublegetAccountCredits()Determine the remaining faxing credits in your accountOutboundFaxStructure[]getCompletedFaxList(String[] ids)Get details for a subset of completed faxes from a submitted list.OutboundFaxStructure[]getFaxList()Get a list of recent outbound faxes (which does not include batch faxes)OutboundFaxStructure[]getFaxList(Optional<GetFaxListOptions> options)Get a list of recent outbound faxes (which does not include batch faxes) withGetFaxListOptionsInboundFaxesEmailsStructuregetInboundFaxForwardingEmails(String id)Retrieve the list of email addresses to which a fax was forwardedbyte[]getInboundFaxImage(long id)Retrieves a single fax's imageInboundFaxStructure[]getInboundFaxList()Retrieves a user's list of inbound faxes.InboundFaxStructure[]getInboundFaxList(Optional<GetInboundFaxListOptions> options)Retrieves a user's list of inbound faxes.InboundFaxStructuregetInboundFaxRecord(String id)Retrieves a single fax's metadata (receive time, sender number, etc.)byte[]getOutboundFaxImage(String id)Retrieve the fax image (TIFF file) of a submitted faxOutboundFaxStructuregetOutboundFaxRecord(String id)Retrieves information regarding a previously-submitted fax, including its current statusUploadedDocumentStatus[]getUploadedDocumentsList()Get a list of previous document uploads which are currently availableUploadedDocumentStatus[]getUploadedDocumentsList(Optional<GetUploadedDocumentsListOptions> options)Get a list of previous document uploads which are currently available withGetUploadedDocumentsListOptionsUploadedDocumentStatusgetUploadedDocumentStatus(String documentId)Get the current status of a specific document uploadAPIResponsehideFax(String id)Hide a fax from listing in queries (there is no way to unhide a fax)APIResponsemarkInboundFax(String id, Optional<Boolean> unread)Mark a transaction as read/unreadAPIResponseresendFax(String id, Optional<String> faxNumber)Resend a previously-submitted fax, without needing to re-upload the original documentAPIResponseresendInboundFax(String id, Optional<String> email)Resend an inbound fax to a specific email addressOutboundFaxStructure[]searchFaxList()Search for outbound faxesOutboundFaxStructure[]searchFaxList(Optional<SearchFaxOptions> options)Search for outbound faxes withSearchFaxOptionsAPIResponsesendFax(String faxNumber, File fileToSendAsFax)Send a single file as faxAPIResponsesendFax(String faxNumber, File[] filesToSendAsFax)Send an array of files as a faxAPIResponsesendFax(String faxNumber, File[] filesToSendAsFax, Optional<SendFaxOptions> options)Send an array of files as a fax with additionalSendFaxOptionsAPIResponsesendFax(String faxNumber, File fileToSendAsFax, Optional<SendFaxOptions> options)Send a single file as fax with additionalSendFaxOptionsAPIResponsesendFax(String faxNumber, InputStream[] streamsToSendAsFax, String[] fileNames)Send an array of input streams as a faxAPIResponsesendFax(String faxNumber, InputStream[] streamsToSendAsFax, String[] mediaTypes, Optional<SendFaxOptions> options)Send an array of input streams as a fax with additionalSendFaxOptionsAPIResponsesendFax(String faxNumber, String urlOfDoc)Send a pre-uploaded document, available on a HTTP url, as a faxAPIResponsesendFax(String faxNumber, String urlOfDoc, Optional<SendFaxOptions> options)Send a pre-uploaded document, available on a HTTP url, as a fax with additionalSendFaxOptionsAPIResponseuploadChunk(String uploadChunkToDocumentEndpoint, byte[] bytesToUpload, int startByteRange, int endByteRange, boolean lastChunk)Upload chunks to an existing document upload sessionAPIResponseuploadDocument(File fileToUpload)Upload contents of file as a document to send later as a fax.APIResponseuploadDocument(File fileToUpload, Optional<DocumentUploadSessionOptions> options)Upload contents of file as a document to send later as a fax, withDocumentUploadSessionOptions.
-
-
-
Method Detail
-
sendFax
APIResponse sendFax(String faxNumber, File fileToSendAsFax) throws IOException, URISyntaxException
Send a single file as fax- Parameters:
faxNumber- number to fax tofileToSendAsFax- file to send as fax- Returns:
APIResponse- Throws:
IOExceptionURISyntaxException- See Also:
- https://www.interfax.net/en/dev/rest/reference/2918
-
sendFax
APIResponse sendFax(String faxNumber, File fileToSendAsFax, Optional<SendFaxOptions> options) throws IOException, URISyntaxException
Send a single file as fax with additionalSendFaxOptions- Parameters:
faxNumber- number to fax tofileToSendAsFax- file to send as faxoptions-SendFaxOptionsto use when sending the fax- Returns:
APIResponse- Throws:
IOExceptionURISyntaxException- See Also:
- https://www.interfax.net/en/dev/rest/reference/2918
-
sendFax
APIResponse sendFax(String faxNumber, File[] filesToSendAsFax) throws IOException, URISyntaxException
Send an array of files as a fax- Parameters:
faxNumber- number to fax tofilesToSendAsFax- array of files to send as fax- Returns:
APIResponse- Throws:
IOExceptionURISyntaxException- See Also:
- https://www.interfax.net/en/dev/rest/reference/2918
-
sendFax
APIResponse sendFax(String faxNumber, InputStream[] streamsToSendAsFax, String[] fileNames) throws IOException, URISyntaxException
Send an array of input streams as a fax- Parameters:
faxNumber- number to fax tostreamsToSendAsFax- array of input streams to send as faxfileNames- array of file names corresponding to the input streams (for mime detection)- Returns:
APIResponse- Throws:
IOExceptionURISyntaxException- See Also:
- https://www.interfax.net/en/dev/rest/reference/2918
-
sendFax
APIResponse sendFax(String faxNumber, File[] filesToSendAsFax, Optional<SendFaxOptions> options) throws IOException, URISyntaxException
Send an array of files as a fax with additionalSendFaxOptions- Parameters:
faxNumber- number to fax tofilesToSendAsFax- array of files to send as faxoptions-SendFaxOptionsto use when sending the fax- Returns:
APIResponse- Throws:
IOExceptionURISyntaxException- See Also:
- https://www.interfax.net/en/dev/rest/reference/2918
-
sendFax
APIResponse sendFax(String faxNumber, InputStream[] streamsToSendAsFax, String[] mediaTypes, Optional<SendFaxOptions> options) throws IOException, URISyntaxException
Send an array of input streams as a fax with additionalSendFaxOptions- Parameters:
faxNumber- number to fax tostreamsToSendAsFax- array of input streams to send as faxmediaTypes- array of strings representing theMediaTypecorresponding to the input streamsoptions-SendFaxOptionsto use when sending the fax- Returns:
APIResponse- Throws:
IOExceptionURISyntaxException- See Also:
- https://www.interfax.net/en/dev/rest/reference/2918
-
sendFax
APIResponse sendFax(String faxNumber, String urlOfDoc) throws URISyntaxException
Send a pre-uploaded document, available on a HTTP url, as a fax- Parameters:
faxNumber- number to fax tourlOfDoc- url of doc to send as fax- Returns:
APIResponse- Throws:
URISyntaxException
-
sendFax
APIResponse sendFax(String faxNumber, String urlOfDoc, Optional<SendFaxOptions> options) throws URISyntaxException
Send a pre-uploaded document, available on a HTTP url, as a fax with additionalSendFaxOptions- Parameters:
faxNumber- number to fax tourlOfDoc- url of doc to send as faxoptions-SendFaxOptionsto use when sending the fax- Returns:
APIResponse- Throws:
URISyntaxException
-
resendFax
APIResponse resendFax(String id, Optional<String> faxNumber)
Resend a previously-submitted fax, without needing to re-upload the original document- Parameters:
id- the ID of the fax to be resent.faxNumber- optional faxNumber to resend to; if not provided defaults to the fax number to which this fax was previously sent.- Returns:
APIResponse- See Also:
- https://www.interfax.net/en/dev/rest/reference/2908
-
getFaxList
OutboundFaxStructure[] getFaxList() throws UnsuccessfulStatusCodeException
Get a list of recent outbound faxes (which does not include batch faxes)- Returns:
- array of
OutboundFaxStructure - Throws:
UnsuccessfulStatusCodeException- See Also:
- https://www.interfax.net/en/dev/rest/reference/2920
-
getFaxList
OutboundFaxStructure[] getFaxList(Optional<GetFaxListOptions> options) throws UnsuccessfulStatusCodeException
Get a list of recent outbound faxes (which does not include batch faxes) withGetFaxListOptions- Parameters:
options-GetFaxListOptionsto make the request with- Returns:
- array of
OutboundFaxStructure - Throws:
UnsuccessfulStatusCodeException- See Also:
- https://www.interfax.net/en/dev/rest/reference/2920
-
getCompletedFaxList
OutboundFaxStructure[] getCompletedFaxList(String[] ids) throws UnsuccessfulStatusCodeException
Get details for a subset of completed faxes from a submitted list. (Submitted id's which have not completed are ignored).- Parameters:
ids- comma-delimited list of fax id's to retrieve, if they have completed.- Returns:
- array of
OutboundFaxStructure - Throws:
UnsuccessfulStatusCodeException- See Also:
- https://www.interfax.net/en/dev/rest/reference/2972
-
getOutboundFaxRecord
OutboundFaxStructure getOutboundFaxRecord(String id) throws UnsuccessfulStatusCodeException
Retrieves information regarding a previously-submitted fax, including its current status- Parameters:
id- the ID of the fax for which to retrieve data.- Returns:
OutboundFaxStructure- Throws:
UnsuccessfulStatusCodeException- See Also:
- https://www.interfax.net/en/dev/rest/reference/2921
-
getOutboundFaxImage
byte[] getOutboundFaxImage(String id) throws UnsuccessfulStatusCodeException
Retrieve the fax image (TIFF file) of a submitted fax- Parameters:
id- the ID of the fax for which to retrieve the image.- Returns:
- byte[] representation of the image
- Throws:
UnsuccessfulStatusCodeException- See Also:
- https://www.interfax.net/en/dev/rest/reference/2941
-
cancelFax
APIResponse cancelFax(String id)
Cancel a fax in progress- Parameters:
id- ID of the fax to be cancelled. Note: This operation may be applied to single faxes or to individual faxes in a batch.- Returns:
APIResponse- See Also:
- https://www.interfax.net/en/dev/rest/reference/2939
-
searchFaxList
OutboundFaxStructure[] searchFaxList() throws UnsuccessfulStatusCodeException
Search for outbound faxes- Returns:
- array of
OutboundFaxStructure - Throws:
UnsuccessfulStatusCodeException- See Also:
- https://www.interfax.net/en/dev/rest/reference/2959
-
searchFaxList
OutboundFaxStructure[] searchFaxList(Optional<SearchFaxOptions> options) throws UnsuccessfulStatusCodeException
Search for outbound faxes withSearchFaxOptions- Parameters:
options-SearchFaxOptionsto make the request with- Returns:
- array of
OutboundFaxStructure - Throws:
UnsuccessfulStatusCodeException- See Also:
- https://www.interfax.net/en/dev/rest/reference/2959
-
hideFax
APIResponse hideFax(String id)
Hide a fax from listing in queries (there is no way to unhide a fax)- Parameters:
id- ID of fax to be hidden- Returns:
APIResponse- See Also:
- https://www.interfax.net/en/dev/rest/reference/2940
-
uploadDocument
APIResponse uploadDocument(File fileToUpload)
Upload contents of file as a document to send later as a fax. Suitable for large files as the upload process automatically breaks the document into 1 MB chunks and uploads them- Parameters:
fileToUpload- file to upload- Returns:
APIResponse- See Also:
- https://www.interfax.net/en/dev/rest/reference/2963
-
uploadDocument
APIResponse uploadDocument(File fileToUpload, Optional<DocumentUploadSessionOptions> options)
Upload contents of file as a document to send later as a fax, withDocumentUploadSessionOptions. Suitable for large files as the upload process automatically breaks the document into 1 MB chunks and uploads them- Parameters:
fileToUpload- file to uploadoptions-DocumentUploadSessionOptions- Returns:
APIResponse- See Also:
- https://www.interfax.net/en/dev/rest/reference/2963
-
uploadChunk
APIResponse uploadChunk(String uploadChunkToDocumentEndpoint, byte[] bytesToUpload, int startByteRange, int endByteRange, boolean lastChunk)
Upload chunks to an existing document upload session- Parameters:
uploadChunkToDocumentEndpoint-bytesToUpload-startByteRange-endByteRange-lastChunk-- Returns:
APIResponse- See Also:
- https://www.interfax.net/en/dev/rest/reference/2966
-
getUploadedDocumentsList
UploadedDocumentStatus[] getUploadedDocumentsList() throws UnsuccessfulStatusCodeException
Get a list of previous document uploads which are currently available- Returns:
- array of
UploadedDocumentStatus - Throws:
UnsuccessfulStatusCodeException- See Also:
- https://www.interfax.net/en/dev/rest/reference/2968
-
getUploadedDocumentsList
UploadedDocumentStatus[] getUploadedDocumentsList(Optional<GetUploadedDocumentsListOptions> options) throws UnsuccessfulStatusCodeException
Get a list of previous document uploads which are currently available withGetUploadedDocumentsListOptions- Parameters:
options-GetUploadedDocumentsListOptionsto make the request with- Returns:
- array of
UploadedDocumentStatus - Throws:
UnsuccessfulStatusCodeException- See Also:
- https://www.interfax.net/en/dev/rest/reference/2968
-
getUploadedDocumentStatus
UploadedDocumentStatus getUploadedDocumentStatus(String documentId) throws UnsuccessfulStatusCodeException
Get the current status of a specific document upload- Parameters:
documentId- the ID of the upload to be queried- Returns:
UploadedDocumentStatus- Throws:
UnsuccessfulStatusCodeException- See Also:
- https://www.interfax.net/en/dev/rest/reference/2965
-
cancelDocumentUploadSession
APIResponse cancelDocumentUploadSession(String documentId)
Cancel a document upload and tear down the upload session, or delete a previous upload- Parameters:
documentId- the ID of the document upload session to be closed- Returns:
APIResponse- See Also:
- https://www.interfax.net/en/dev/rest/reference/2964
-
getAccountCredits
Double getAccountCredits() throws UnsuccessfulStatusCodeException
Determine the remaining faxing credits in your account- Returns:
- Value of outstanding outbound credits in account, in the account's currency
- Throws:
UnsuccessfulStatusCodeException- exception with status code and response body if present- See Also:
- https://www.interfax.net/en/dev/rest/reference/3001
-
getInboundFaxList
InboundFaxStructure[] getInboundFaxList() throws UnsuccessfulStatusCodeException
Retrieves a user's list of inbound faxes. (Sort order is always in descending ID)- Returns:
- array of
InboundFaxStructure - Throws:
UnsuccessfulStatusCodeException- See Also:
- https://www.interfax.net/en/dev/rest/reference/2935
-
getInboundFaxList
InboundFaxStructure[] getInboundFaxList(Optional<GetInboundFaxListOptions> options) throws UnsuccessfulStatusCodeException
Retrieves a user's list of inbound faxes. (Sort order is always in descending ID) withGetInboundFaxListOptions- Parameters:
options-GetInboundFaxListOptionsto make the request with- Returns:
- array of
InboundFaxStructure - Throws:
UnsuccessfulStatusCodeException- See Also:
- https://www.interfax.net/en/dev/rest/reference/2935
-
getInboundFaxRecord
InboundFaxStructure getInboundFaxRecord(String id) throws UnsuccessfulStatusCodeException
Retrieves a single fax's metadata (receive time, sender number, etc.)- Parameters:
id- the ID of the fax data to be retrieved- Returns:
InboundFaxStructure- Throws:
UnsuccessfulStatusCodeException- See Also:
- https://www.interfax.net/en/dev/rest/reference/2938
-
getInboundFaxImage
byte[] getInboundFaxImage(long id) throws UnsuccessfulStatusCodeExceptionRetrieves a single fax's image- Parameters:
id- the ID of the fax image to be retrieved- Returns:
- byte array representation of the fax image
- Throws:
UnsuccessfulStatusCodeException- See Also:
- https://www.interfax.net/en/dev/rest/reference/2937
-
getInboundFaxForwardingEmails
InboundFaxesEmailsStructure getInboundFaxForwardingEmails(String id) throws UnsuccessfulStatusCodeException
Retrieve the list of email addresses to which a fax was forwarded- Parameters:
id- the ID of the fax for which forwarding addresses are to be retrieved- Returns:
InboundFaxesEmailsStructure- Throws:
UnsuccessfulStatusCodeException- See Also:
- https://www.interfax.net/en/dev/rest/reference/2930
-
markInboundFax
APIResponse markInboundFax(String id, Optional<Boolean> unread)
Mark a transaction as read/unread- Parameters:
id- the ID of the fax to be markedunread- FALSE = mark as read, TRUE = mark as unread.- Returns:
APIResponse- See Also:
- https://www.interfax.net/en/dev/rest/reference/2936
-
resendInboundFax
APIResponse resendInboundFax(String id, Optional<String> email)
Resend an inbound fax to a specific email address- Parameters:
id- the ID of the fax to be resent by emailemail- email address to which to forward the inbound fax- Returns:
APIResponse- See Also:
- https://www.interfax.net/en/dev/rest/reference/2929
-
closeClient
void closeClient()
Close underlying client and free up any held system resources
-
-