Recipes← all recipesView on GitHub

Send a fax

Faxprogrammable fax

A fax is sent from a document URL and its status webhook reports pages and result.

fax

The claim

Fax is one REST call, POST .../Faxes with To, From and a MediaUrl pointing at a PDF, followed by a wait. Transmission takes minutes and can fail half-way, so the outcome (delivered with NumPages, or failed with an ErrorCode) arrives at StatusCallback; the create response only says queued.

How it works

client.compat.faxes.create(To=to, From=FROM, MediaUrl=pdf_url, Quality="fine",
                           StatusCallback=f"{PUBLIC_URL}/fax-status")

The send goes through the Compatibility API’s Faxes endpoint (/api/laml/2010-04-01/Accounts/<project>/Faxes). There is no native /api/fax send; the native surface has fax logs (GET /api/fax/logs) for reconciliation. From inside a call the same operation is the SWML verb send_fax; over RELAY it is call.send_fax. Non-final statuses (queued, processing, sending) are ignored by the handler; final ones are recorded.

What to change first

Point MediaUrl at a document your own app generated a minute earlier, and retry on busy or no-answer with a backoff, because the fax world still has both.