How to integrate MetroFax API with PHP

MetroFax is a leading Online Fax Service provider with advanced features and flexible usage plans.ย  Online Fax Service reduces the waste and expense of paper, ink, and toner cartridges. It has its own API to send and receive online faxes so we can Integrate MetroFax API with Sales management systems, CRM systems or any other Software systems.

Steps to Integrate MetroFax API with PHP

Download MetroFax.class.php file and include this PHP file using include function. Create an object of MetroFax class.

Send a Fax

To send a document using MetroFax API we have to upload a document to MetroFax Server. Only after uploading a document to their server we can fax it to any fax number. MetroFax will give Unique attachment id in response and using it we can send uploaded document to any fax number. Below is the perfect code to send a fax.

Pass Fax Number with country code. In above example, Fax Number is (510)586-8243 and Country code is 1.

We will get Tracking Number in the response of sendFaxMessage. Store this Tracking Number in the database for future reference. Using Tracking Number we can get all the important information of fax like Fax Status, FaxID, Transmission Date, Cost Per Unit and Page Count.

Get a Fax Status

We can get a Fax Status using Tracking Number. Call below function to get the status of sent fax.

Status has itโ€™s own meaning as below
0 -> Fax is sent Successfully.
2 -> Fax is Deleted
3 -> Fax is still Transmitting
4 -> Fax is in Pending state.

List Inbound Faxes (Incoming Faxes)

To list incoming Faxes call listInboundFax function as below.

Get Inbound Fax Documents (Incoming Fax Documents)

To get incoming fax documents call getFaxImageData function as mentioned below

You can download MetroFax API code with all examples by clicking below link
Download MetroFax API with PHP

Let me know if you need any help in MetroFax API Integration. Happy to help ๐Ÿ™‚

Happy MetroFaxing ๐Ÿ™‚

You may also like

Sharing is caring!