Here is what we are going to do:
- Check for new faxes using a new api call: Fax_GetProductsWithInboundFaxes
- Get a collection of inbound faxes for us to process.
Here is what you need:
- We will assume you are using a relatively modern development framework. PHP, React, .Net, etc…
- We recommend you use a tool like Postman (Free and available on all platforms) to test your API’s and generate the code or you can run in a sandbox at SwaggerHub.
- Developer API account. Easy to sign up and get started immediately.
- If you haven’t implemented the API before you may want to check out our quickstart how-to articles here and here.
What is this useful for:
This is useful if you have multiple inbound fax lines and you need to check them for new inbound faxes. Just calling this one procedure will alert you to new inbound faxes and you can then go and retrieve the metadata about the new faxes. If nothing is new you don’t have to make a call for each productID which saves server time and resources.
Phase 1: Let’s check our Fax number for new faxes.
In this case I have sent myself a test fax before I run this proc.
I am going to fire up SwaggerHub and use the Tryout function to call the procedure and get data back.
The procedure is called Fax_GetProductsWithInboundFaxes. You can see it’s spec here.
We are going to call the proc using the Try Out feature.
- We’ll be asked to enter the Username and Password for our WestFax API Call. Notice we are not specifying a prodid as this procedure works across all fax lines and will return a collection of fax lines if the filter field matches.
- Let’s talk about the filter field. If you leave it blank it will assume Unread flag. You can set it to None, Recieved & Removed. None or <blank> will show you Fax numbers that have unread faxes. Recieved will show you fax lines that have read faxes and removed will show you faxes that have deleted faxes. These are unlikely use-cases but here nevertheless.
- So here is the call:
- When I execute it I get back:
- You can see that it returns a ID record as well as the InboundNumber so you can now go call the Fax_GetFaxDescriptions or Fax_GetInboundFaxDescriptions. Set your FaxDirection as Inbound and you can now update your app with the new incoming faxes.