We are trying to implement the Fax Inbound/Outbound messaging using the Spring Integration gateways using the Java based configuration with Interfax API. The rest services are : outbound : https://rest.interfax.net/outbound/faxes Inbound: https://rest.interfax.net/inbound/faxes

Can you please help, how the payloads will be for this API, which will contain fax_number, file, content_type, etc.,

How the gateways can be created for both the Inbound & Outbound faxes. Please suggest the approaches.

1

There are 1 answers

0
Eyal Nevo On

We now offer an easy-to-use library for Java to allow customers to easily integrate the InterFAX API into their own system.

For the outbound API, to send a fax, all you will need is the file you wish to send, the fax number of the destination and the credentials for InterFAX. The request to the API to send a fax should look something similar to the following (assuming you are sending a PDF file):

POST /outbound/faxes?faxNumber=0018885551234&reference=this is my fax HTTP/1.1
Host: rest.interfax.net
Authorization: Basic ZXlhbG5ldm86WkFRIXphcTFuaHk2
Content-Type: application/pdf
Cache-Control: no-cache

[file binary content goes here]

For the inbound API, you can search for faxes to retrieve their metadata and then you download the fax image of a specific fax. The request to the API to search for faxes would look something like this:

GET /inbound/faxes?limit=10 HTTP/1.1
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
Host: rest.interfax.net.

InterFAX also offers a callback system (for both inbound and outbound faxes) -- you can read this article comparing the differences between polling and callback -- which will push notifications and status updates to customer's web service - for outbound faxes, once the fax has been completed processing and for inbound faxes, once a new fax has been received.

We would recommend to build a gateway that based on a callback input from InterFAX for inbound faxes, the gateway will store all fax metadata in the callback and then proceed to download the fax image - storing all information in a location accessible by the end user. For outbound faxes, you will need to create a form submission of some kind for the end customers to submit their fax information. Once submitted, the fax will be submitted to InterFAX via the API and the resulting fax transaction ID (which is returned to you as the response for submitting the fax), will be stored in a local database. Once the fax has been completed, the callback will trigger an update to your system to update the fax records in your database.