Some Basic Examples
The 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.
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.
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:
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:
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.