Send

View as Markdown

Use this endpoint for the Fax method to send a Fax.

Path parameters

AccountSidstringRequiredformat: "uuid"
The Project ID that uniquely identifies the Account.

Request

MediaUrlstringRequired
The URL hosting the fax media to send.
TostringRequired
The phone number, in E.164 format, or SIP URI the fax will be sent to.
FromstringRequired
The phone number, in E.164 format, or client identifier the fax will be sent from.
QualityenumOptionalDefaults to fine
The quality of the fax. Default is 'fine'.
Allowed values:
StatusCallbackstringOptional
The URL to send status callback requests to when the fax status changes.
StatusCallbackMethodenumOptionalDefaults to POST
The HTTP method to use for status callback requests. Default is 'POST'.
Allowed values:
StatusCallbackEventlist of stringsOptional
The events that trigger status callback requests. Valid values: 'initiated', 'ringing', 'answered', 'completed', 'ringing_forwarded', 'ringing_queued'. Default is ['completed'].
StoreMediaenumOptionalDefaults to true
Whether to store the fax media. Default is 'true'.
Allowed values:
TtlintegerOptional5-300Defaults to 60
Time to live in minutes for the fax. Must be between 5 and 300. Default is 60.
SipAuthUsernamestringOptional
The username for SIP authentication.
SipAuthPasswordstringOptional
The password for SIP authentication.

Response

account_sidstringRequired
The unique identifier for the account this fax is associated with.
api_versionstringRequired
The version of the SignalWire API.
date_createdstringRequired
The date and time, in ISO 8601 format, the fax was created.
date_updatedstringRequired
The date and time, in ISO 8601 format, the fax was updated.
directionenumRequired
The direction of the fax.
Allowed values:
fromstringRequired
The phone number, in E.164 format, the fax was sent from.
media_urlstring or nullRequired
The URL hosting the received media, or null if not available.
media_sidstringRequired
The unique identifier for the media instance associated with the fax instance.
num_pagesstring or nullRequired
The number of pages in the fax document, or null if not yet determined.
pricestring or nullRequired
The cost of the fax, or null if not yet calculated.
price_unitstringRequired
The currency, in ISO 4217 format, of the price.
qualityenumRequired
The quality of the fax.
Allowed values:
sidstringRequired
The unique identifier of the fax.
statusenumRequired
The status of the fax.
tostringRequired
The phone number, in E.164 format, the fax was sent to.
durationintegerRequired
The time, in seconds, it took to deliver a fax.
urlstringRequired
The URL of this resource.
error_codestring or nullRequired
Error code for this resource, or null if no error.
error_messagestring or nullRequired
The description of this error, or null if no error.

Request examples

1const { RestClient } = require('@signalwire/compatibility-api')
2const client = RestClient('YourProjectID', 'YourAuthToken', { signalwireSpaceUrl: 'example.signalwire.com' })
3
4client.fax.faxes
5 .create({
6 from: '+13103383454',
7 to: '+13104456789',
8 mediaUrl: 'https://example.com/fax.pdf'
9 })
10 .then(fax => console.log(fax.sid))
11 .done();

StatusCallback parameters

The StatusCallback request contains the following parameters:

RemoteStationId
string

The transmitting subscriber identification (TSID) reported by the fax machine that sent in the fax.

FaxStatus
string

The status of the fax.

OriginalMediaUrl
string

The original URL passed when a fax is sent.

NumPages
integer

The number of pages received from a successful fax.

MediaSid
string

The SID that uniquely identifies the fax media.

MediaUrl
string

The media URL to request to retrieve incoming media.

ErrorCode
string

The error code provides more information on a failed fax.

ErrorMessage
string

The message explaining the reason for fax failure.