Getting Started with the WestFax API

Some Basic Examples

Cloud API imageThe WestFax API offers developers a powerful and flexible way to integrate fax capabilities into their workflows. Whether you’re building an application that automates document delivery or creating a custom solution for handling secure communications, the API provides everything you need to get started. In this guide, we’ll walk through verifying connectivity with the Ping-Pong test and demonstrate a simple example of sending a fax.

1. Verifying Connectivity with the Ping-Pong API

Before diving into more advanced API calls, it’s a good idea to test your connection using the Ping-Pong call. This endpoint provides a quick and simple way to ensure that your integration with the WestFax API is set up correctly.

API Endpoint:
https://apisecure.westfax.com/REST/Security_Ping/json

Purpose:
This call sends a "ping" to the API and receives a "pong" in response, confirming that the connection is working as expected.

Example cURL Command:

curl --location 'https://apisecure.westfax.com/REST/Security_Ping/json' \
     --form 'StringParams1="ping "'

Expected Response (Single Line):

{"Success":true,"Result":"Pong - \"ping \""}

With this quick test, you can verify that your integration is functional and ready for the next steps.

2. Sending a Fax with the WestFax API

Once you’ve verified connectivity, the next step is to send a fax using the WestFax API. This example demonstrates a simple API call to send a document to a specified fax number.

API Endpoint:
https://apisecure.westfax.com/REST/Fax_SendFax/json

Prerequisites:

  1. Credentials: It is recommended to create a dedicated API account (e.g., faxapi@example.com) to prevent breaking the integration if your personal account credentials are changed.
  2. ProductID: This is a unique identifier for your fax line. You can find it in the WestFax portal by navigating to Settings → Fax Configuration → Manage Fax Lines, then clicking Edit.
  3. File to Send: A document ready to fax (e.g., /home/user/fax.pdf).

Example cURL Command:

curl --location 'https://apisecure.westfax.com/REST/Fax_SendFax/json' \
     --header 'Content-Type: multipart/form-data' \
     --form 'Username="faxapi@example.com"' \
     --form 'Password="examplepassword"' \
     --form 'Cookies="false"' \
     --form 'ProductId="e593bb08-bdc5-4e26-9c0c-b3970bd50c12"' \
     --form 'CoverPage="coverp12"' \
     --form 'JobName="TestFax"' \
     --form 'Header="Test Header"' \
     --form 'BillingCode="12345"' \
     --form 'Numbers1="5555551234"' \
     --form 'Files0=@/home/user/fax.pdf' \
     --form 'FaxQuality="Fine"' \
     --form 'FeedbackEmail="faxapi@example.com"'

Explanation of Key Fields:

  • Username & Password: Your dedicated API credentials (e.g., faxapi@example.com).
  • ProductId: Unique identifier for the fax line being used.
  • Numbers1: The recipient’s fax number in 10-digit format (e.g., 5555551234).
  • Files0: The full path to the file being faxed (e.g., /home/user/fax.pdf).
  • FeedbackEmail: Email address where status notifications will be sent.
  • CoverPage: The name of the cover page to include with the fax. Cover pages can be customized in the WestFax portal under Settings → Cover Page Editor.
  • JobName: An arbitrary value that acts as the fax's "Subject" in the portal and on the cover page.
  • Header: An arbitrary value that will appear as the header line on the fax itself.
  • BillingCode: An arbitrary value used as the "Reference" field in the portal for internal tracking purposes.

Expected Response (Single Line):

{"Success":true,"Result":"4fd78e7f-da0a-458b-b01b-44f4fd6820fa"}

The response provides the Job ID for the fax, which can be used for tracking and troubleshooting purposes.


Getting started with the WestFax API is straightforward. By first verifying your connectivity with the Ping-Pong test and then making your first Send Fax call, you’re well on your way to integrating secure and reliable faxing into your applications. The API’s simplicity and flexibility make it a powerful tool for developers looking to enhance their workflows.

For more information and advanced features, be sure to explore the WestFax API Documentation. If you have questions or need assistance, the WestFax team is ready to help.

Discover more