
Programmable Fax – API for sending and receiving faxes - jonmarkgo
http://twilio.com/fax
======
pg_bot
If Twilio will sign a business associates agreement, this could be huge in the
healthcare field. EMRs have terrible interoperability so doctors and health
systems typically fax health records to one another. However, this service
does not look HIPAA compliant based on the sparse documentation. It doesn't
look promising that they will sign a BAA according to this document.
[https://support.twilio.com/hc/en-
us/articles/223136467-Ensur...](https://support.twilio.com/hc/en-
us/articles/223136467-Ensuring-HIPAA-compliancy-with-Twilio-made-applications)

~~~
faxman
You might want to take a look our service, Interfax, an API-powered internet
fax service provider, which addresses HIPAA and offers BAA's.

In fact, we cover a range of regulatory/standard requirements such as PCI-DSS
(Tier 1) and EU GDPR.

We're now also looking at the Oz equivalent of these types of legislation.

[https://www.interfax.net/en/hipaa_compliance](https://www.interfax.net/en/hipaa_compliance)

~~~
gameshot911
I'm only familiar with RightFax in the EHR world. How does Interfax compares
to it (are they even filling the same need)?

~~~
faxman
InterFAX is the SaaS version of RightFax. No installation of hardware,
software, or phone lines required. (But, as with any Saas, trust in the vendor
is necessary).

------
kevinburke
This has been kicked around for a really long time and I'm happy they finally
launched it.

Around 2013 or so, one of the junior engineers on the Twilio Voice team
pitched his innovation week project with a single slide saying "Fax: The time
is now." The time has finally arrived! Congrats John.

~~~
tyingq
Guessing this will kill Phaxio. Compare the pricing:

[https://www.twilio.com/fax/pricing](https://www.twilio.com/fax/pricing)

[https://www.phaxio.com/pricing/](https://www.phaxio.com/pricing/)

~~~
beaconstudios
it's amazing that phaxio have gotten away with such high prices for so long.

~~~
rabidonrails
Phaxio founder here.

Our pricing might seem higher (and may be in certain situations), but it works
a bit differently that Twilio's. Twilio charges you the 1c _plus_ the costs of
the call. Phaxio is an "all in" rate _including_ retrying the call. And, at
Phaxio, if the calls all fail there's no cost to you.

I'm not saying that we won't adjust our pricing (#competition), but there's a
difference in the actual unit cost.

~~~
IgorPartola
How long does it take to send a page of fax? Their pricing is 0.007 per
minute. I haven't seen many fax machines take more than a minute per page, but
they would have to take 10 minutes to catch up to your pricing.

Edit: Fixed time to comparable pricing.

~~~
kelnos
I'd be surprised to see more than a couple minutes for even a complicated fax
page. I've seen 45-70 seconds average for a not-too-complicated page.

It also depends on the baud rate (never thought _that_ term would come back,
eh?) negotiated between both ends. A 14400 baud transmission will of course be
faster than 9600.

~~~
nojvek
I paid $10 to send a 28 page fax. I absolutely believe utility and govt
companies still use fax because they want to make somethings very hard for the
average customer. There's no reason why I shouldn't be able to send an email a
pdf to show good credit so they don't charge me a deposit fee.

Twilio please build a mobile app so those of us who don't live with
typewriters and fax machines can deal with our nasty govt.

~~~
karlmdavis
Where in the government do you still have to fax things?

~~~
tyingq
This had me curious, so I tried googling for

    
    
      site: *.gov fax
    

Was surprised at the results. It may not be the only conduit, but it is there
for job applications, VA benefits, applying for a headstone in a national
cemetery, court filings, IRS documents, and much more.

------
coffeedoughnuts
I just assumed from first glance that this was an early April Fools (I guess
it must be April 1st in Australia by now)

But after seeing full API docs... is this real? I'm so confused!

~~~
sorenjan
I'm guessing it's an American thing. I think they still use checks too.

~~~
aidenn0
In the US, checks are free; wire transfers cost money. Yes, that's annoying.

[edit]

Even stranger, I can go online and have my bank mail a check to anywhere in
the US for free. It's $20 to send it directly to someone's bank account.

~~~
sorenjan
The concept of mailing pieces of paper as a way to pay bills is so strange to
me. Fore reference, I'm in my mid thirties and have never used a check in my
life. I remember my mom used them when I was very young, but I don't think
I've even seen one in about thirty years.

~~~
throwaway9475
You've never taken piano lessons or bought Girl Scout cookies or paid rent,
have you.

~~~
sorenjan
No, don't have them here, and yes I have, but bills like rent go straight to
my online bank.

------
apeace
If anyone's first reaction was along the lines of: "Faxing in 2017?" or "Is
this an April Fool's joke?", consider that the healthcare industry still uses
faxes frequently.

I once interviewed at a company that was building software for ordering
durable medical equipment in hospitals. They told me that all orders were
faxed to the insurance companies, and the error rate for copying data to the
faxed form was about 90%. This results in repeated fax transmissions and
patients waiting days to know whether their insurance company will buy them a
wheelchair.

Using an API like this, you can at least digitize one end of the process,
error-free, and still deliver the expected fax to the other side which hasn't
upgraded yet.

~~~
Roboprog
No :-)

My first reaction was "I have to rewrite one of these in a week or two, is
this API easier/cheaper to use than our current vendor?"

I suppose if this post had come up a few months earlier or later, I would not
have cared so much. But today, I'm all over it.

------
Roboprog
Here's how it looks like it works to me:

(their stuff is of course HTTPS, and I'm assuming the caller's support links
would be as well. Each REST call also has authentication tokens, of course)

=== Out: ===

You POST data to their REST resource, including a link to your PDF document,
which they pull (as well as phone number data). Presumably, you want to add
some kind of temporary security token/nonce to the link that you give them.

Twilio uses the link to pull your PDF, and sends it to the previously
indicated number.

=== In: ===

You GET a list of FAX doc IDs. I don't see query parameters for date ranges
and/or phone numbers, but presumably you can do so.

You GET the metadata for a FAX ID obtained from the previous list. This
includes a temporary link for the image data.

You GET the image data from the indicated "authenticating" temporary link.
It's unclear what the format is (accept headers???), but it's likely PDF only.

===

What seems to be missing in this process is a way to associate an inbound FAX
with an outbound FAX (e.g. - barcode or other built in OCR index value). This
is needed so that you can support "sign this and send it back" workflows. The
phone number is not enough: many docs could go to the same phone number, and
the remote signer could send the FAX back from any number, anyway.

~~~
faxman
Your description is right. To give this a visual dimension, here are sequence
diagrams showing how outbound and inbound faxing work at another provider
(disclaimer: I'm a co-founder at Interfax):

Outbound: [https://www.interfax.net/en/dev/dev-guide/using-interfax-
for...](https://www.interfax.net/en/dev/dev-guide/using-interfax-for-sending-
faxes)

Inbound: [https://www.interfax.net/en/dev/dev-guide/using-interfax-
for...](https://www.interfax.net/en/dev/dev-guide/using-interfax-for-
receiving-faxes)

Your suggestion for a "sign this and send it back" workflow is an excellent
idea. Indeed it shouldn't require more than a single fax number per client,
leaving the barcode to do any necessary association. But I would say that this
functionality is not best placed on the fax service provider's system, but
rather in the application that creates the document to be signed and
eventually receives it back. Here's what I mean:
[http://imgur.com/a/JEldx](http://imgur.com/a/JEldx)

~~~
Roboprog
Thanks for the sequence diagram. That's exactly what we're doing.

------
troyastorino
Anyone see anything about how they handle simultaneous incoming faxes to the
same number? With other faxing APIs we've used, if we get a new inbound fax
while another is being received, the second (new) inbound fax will get a busy
signal and not get procewsed.

Phaxio has said they can handle any number of simultaneous inbound faxes, but
we haven't had a chance to try them yet. It would be nice to know if Twilio is
an option.

~~~
kelnos
Multiple simultaneous incoming is fine. They'll all get received properly.

~~~
theLearningChan
HOW WOULD YOU KNOW!

/s

------
bizzleDawg
The shocking thing about this is that there must still be enough Faxes being
sent to actually justify this new product.

Where are they still used at 'scale'?

~~~
patio11
A _lot_ of the Uber-for-food-delivery startups use them for ordering at
restaurants because there is no text-based API to restaurants and the UX of
receiving an automated phone call is poor.

They're _pervasive_ in finance, insurance, employee benefits, etc.

They're also a good one-to-many API multiplexer. So many businesses can take a
fax and have a human operate on it that many software companies can use them
to add actuators to their software without having to bizdev the company into
adding an actual API integration.

~~~
bambax
> _food-delivery_

So it's easier/cheaper for a restaurant to have a dedicated phone line for
faxing (plus fax and supplies) than connect a printer to a PC?

Is this because someone needs to actually print incoming emails or orders? And
if yes, is there an opportunity for some kind of software solution that would
always print what it receives, with no human intervention?

~~~
ybot
The short answer is 'yes' — fax machines are actually a pretty great solution
to this problem. If you think about it, there isn't really that much overhead
for having a fax line and a $40 fax machine vs running a full computer +
printer combo, set up is trivial, faxes have a very well-understood track
record, and the 'sender' gets direct feedback on whether or not the physical
document was successfully delivered.

If there's a software gap here, it's being filled as features in modern Point
Of Sale systems. That space is really crowded right now (Revel, Clover, Toast,
'more modern' offerings from legacy providers like Micros and NCR). There may
be an opportunity to provide a more niche offering rather than a comprehensive
solution like those, but the space is far from empty.

~~~
bambax
I'm not looking for startup ideas in this domain, I was just wondering "in
general". If the PC + printer is already there (surely it has to be for
accounting, etc.) why have a fax.

But ok, if the fax and the phone line cost next to nothing and it "just
works", then sure it makes a lot of sense.

~~~
ybot
A lot of these restaurants _do_ have a PC + printer in a back room or office
somewhere. If the restaurant is owned by a group (or small chain), that setup
may only exist at one location.

They can (and do!) put the fax machine right by the kitchen.

------
koolba
This is pretty neat. From the API docs it looks like they've really reduced it
down to, " _Here 's a PDF, send this to number XYZ_".

Here's a fun side project for somebody: Make a network tunnel that uses faxes
as a way to send packets back and forth. You can encode the packets as a QR
code, ship it over via fax, and then reply back with another fax. Be cool to
see that in action with a human doing the receipt / transport vs. a fully
automated one (two computers using Twilio API).

------
bankster
Tons of great information on this thread. The idea that in the year 2017 we
are transmitting sensitive data at modem speed technology is somewhat mind
boggling. The fax server market is very mature and has evolved, however the
transport has not. etherFAX has created the largest ecosystem when it comes to
fax and healthcare ([https://etherfax.net/solutions/etherfax-
sen](https://etherfax.net/solutions/etherfax-sen)). etherFAX supports and
serves every major fax server application and EMR. Having over 6 million
connected endpoints in healthcare allows for end-to-end encrypted
transmissions and guaranteed delivery, without traversing the PSTN. The Fax
Federation (faxfederation.com) allows for other fax server providers (like
Twilio) to join said ecosystem.

------
travelton
This is neat! But I have to expose the PDF to the internet for Twilio to pick
up the file and send it?

[https://www.twilio.com/docs/api/fax/quickstart#send-a-
fax](https://www.twilio.com/docs/api/fax/quickstart#send-a-fax)

~~~
j_s
[https://www.twilio.com/docs/api/security#validating-
requests](https://www.twilio.com/docs/api/security#validating-requests)

 _Twilio cryptographically signs its requests_

Not sure on the specifics of a GET vs the normal POST callbacks but they
definitely are aware this is an issue.

~~~
viggity
I'd be surprised if it wasn't similar to (or exactly like) their POST auth.
They concatenate the URL, the post variables (alphabetically sorted) and your
twilio account id and hash it with your auth key. They put that hash into an
auth header on the post.

I had to dig into it because we had a reverse proxy in front of our app and
the hash generated by their client .net library was understandably different
than what they sent because the domains were ultimately different.

------
tommynicholas
Came up with a use case for this within our current product within 30 seconds
of seeing this, love it!

------
zAy0LfpBZLC8mAC
WTF?

"Programmable Fax" \- as if fax was somehow not accessible to computers before
twilio invented a proprietary API for it. Yes, it was, believe it or not: You
can indeed send faxes from software, via a fax modem connected to a landline,
or an ISDN TA connected to an ISDN line, via a GSM MT connected to a GSM
network ...

Or, if you like your internet and don't want to deal with older communications
networks directly, there even is a frickin non-proprietary API for it that was
standardised nearly two decades ago: T.37 and T.38. And there have been
companies offering gateway services that allow you to send faxes to the PSTN
using those APIs for about as long.

------
fapjacks
I am interested in how this works on the back end, and whether or not they're
using t.38. And if they're using t.38, how reliable this service is. As
someone that played with -- nay, engineered -- a faxing solution over a couple
of years' worth of side project time in order to facilitate playing an ARG, I
can say confidently that faxing over VOIP lines ("t.38") is almost impossible
to do reliably.

------
dangerboysteve
now if they could implement barcode recognition for inbound faxes and plug
into taskrouter they would have a very compelling offering.

~~~
Karrot_Kream
What's the use case for barcode recognition? Sorry I've never had to use faxes
much myself so I'm curious.

~~~
troyastorino
For us — we send out requests for medical records to doctors' offices. When
doctors send records back to us, they usually include the cover sheet we sent
over. Since that cover sheet has a barcode on it, we know which record request
the incoming records are for.

~~~
Roboprog
Same. At work we are in the process of rewriting an application that sends
FAXes to doctors for their signatures. The barcode is on the edge of the doc,
rather than the coverpage, but otherwise, same. The barcode is used as less
error prone OCR for a record number so the FAX can be associated with the
right "file". The users requesting the FAX loop view the returned document
when it comes back to verify it (or at least, they will, when I finish
recreating that feature :-) ). HOWEVER, users DO NOT sift through all incoming
documents with data for other people which is none of a given user's business.
Having to do so would be not only an inconvenience, but a data privacy issue.

Plus, I would rather somebody else build doc ID OCR in a language other than
Java so I don't have to build it myself. This is going to come up time and
time again.

------
rsync
Ugh. How can it be possible that my favorite technology service in 2017 is
perpetuating something that _absolutely must die_ ?

 _Common decency_ dictates that we must do everything possible to make faxing
as _hard as possible_.

When someone asks you to fax something, _pretend you have no idea what they
're talking about_.

Then ridicule them.

~~~
cordite
Not everyone that demands a fax wants it through fax. Making someone's job
harder socially won't get a business, organization, or agency to change their
ways.

If you want places like healthcare to stop using faxes, propose a secure
solution that meets their needs and fulfills government requirements /
restrictions.

------
jnankin
Twilio and Phaxio just had a fax based conversation live on youtube

[https://ibb.co/ksStrF](https://ibb.co/ksStrF)
[https://ibb.co/fUFDrF](https://ibb.co/fUFDrF)

------
brightball
Oh thank goodness! I've been waiting for this. Been looking for a quality
alternative to efax for my wife and now I can build one for about 1/10th of
the ongoing cost.

------
kwhitefoot
I think the last time I sent a fax must have been more than ten years ago. How
is sending a fax better than emailing the document file or a scan of the
document if it was already on paper?

As for doctors using faxes,that sounds like a disaster waiting to happen.

I live in Norway, all the health records are online so my GP and any hospital
in the country can see my records (if I give consent), prescriptions are
electronic and paperless, etc. I still get snail mail letters from the health
system but that is simply because I have not got around to applying for a
secure email account (the state gently reminds me now and again).

------
yarper
Time to connect this up to twitter firehose, we can finally fax all the tweets

------
homero
I would love to buy an app that uses this. Faxitnice stole my money

------
sjclemmy
Fax. Aaaaaaaarrrrrrgggggghhhhh.

