First steps with fax

View as Markdown

Prototype, build, and deploy fax applications quickly and at competitive rates using our APIs and SDKs as well as the lightweight SignalWire Markup Language (“SWML”).

Security first
SignalWire Fax is certified SOC 2 Type II compliant, and is built from the ground up for seamless HIPAA compliance.

Learn how to send and receive your first fax using SignalWire. You’ll configure a phone number, create SWML scripts to handle faxes, and use SWML or our APIs to send faxes programmatically.

Prerequisites

Before you begin, you’ll need:

Receiving your first fax

To receive faxes, you’ll configure a phone number to handle incoming faxes using a SWML script that defines what happens when a fax arrives.

1

Obtain a phone number

First, you need a SignalWire phone number capable of receiving faxes.

Log in to your SignalWire Space. If you don’t have a number yet, navigate to the Phone Numbers section and buy a new phone number.

2

Create a script

From your SignalWire Dashboard, create a new Resource by navigating to the resources tab, then select the “New Script” option and choose “New SWML application”.

The new resource dialog showing SWML script
creation.

Navigating to and creating a new SWML resource for handling faxes.

Paste the following code into your script:

1version: 1.0.0
2sections:
3 main:
4 - receive_fax: {}

Save the script. It should now be located in your Resources tab on the left sidebar, under Scripts.

Follow the above guide with these changes:

Create a SWML Script

Navigate to the “RELAY/SWML” section of your Dashboard and create a new SWML Script.

Assign a phone number

Open the settings for your phone number. Under “Voice and Fax Settings”:

  • Set “Accept Incoming Calls As” to “Fax”
  • Set “Handle Faxes Using” to “SWML Script”
  • Select your SWML Script from the dropdown for “When a Fax Comes In”

New Dashboard: You have a Resources tab in the left sidebar.

Legacy Dashboard: You have separate tabs for SIP, LaML, RELAY, etc.

3

Configure phone number

Navigate to the “Phone Numbers” tab on the left sidebar. From this tab, click on your newly purchased phone number, then on the “edit settings” option. In the settings page that appears, select “Assign Resource” for “Inbound Call Settings”.

Phone number settings page showing the Assign Resource button for inbound
calls.

Assign the script to your phone number's inbound call settings.

Select the newly created script, then click “Save” to apply the configuration.

4

Test your setup

Send a test fax to your configured phone number and then open the respective call log found in the Logs section on your left sidebar.

Copy the link found in the Document parameter and paste it into your browser to view your fax.

The logs page showing voice logs where inbound faxes will be received.

View your received faxes in the dashboard logs.

If you prefer to host the fax handling logic yourself, configure a webhook endpoint that returns SWML. See our SWML receive_fax documentation for more details.

You’ll need to make your code accessible to SignalWire through a webhook. In development environments, use a tunneling service like ngrok to expose your local server.

Sending your first fax

SWML can be used to send a fax through the send_fax method. The below example script sends a fax, then posts the result to a predetermined webhook.

1version: 1.0.0
2sections:
3 main:
4 - send_fax:
5 document: https://example.com/fax_to_send.pdf
6 - execute:
7 dest: 'https://example.com/handle_outgoing_fax_result'

Next steps