Hacker News new | past | comments | ask | show | jobs | submit login
Command Line Faxing (petekeen.net)
63 points by zrail on Aug 4, 2014 | hide | past | favorite | 25 comments



Phaxio co-founder here. Thanks for the write up, Pete! Really great to see the product we've been bootstrapping for 3 years on the front page of HN. We're devoted to making developer faxing as easy as possible. If you have any comments or questions about the service, feel free to contact me directly at josh at phaxio dot com.


In general, it's a terrible idea to run a command that contains secret information in the command line. The 'API secret' will be viewable by any user on the machine. (For instance, they could run 'ps waux' and grab the key)

Of course, the script could be running on a machine with only one user, so there might be no problem for this specific case. But it's just good practice to avoid creating potential security holes.


Yep, absolutely right. This is just running on my laptop so there's no other user, but a server-based solution should absolutely hit the API using something like Faraday[1] or requests[2].

[1]: https://github.com/lostisland/faraday

[2]: http://docs.python-requests.org/en/latest/


I think there's an even easier fix here; you can solve it by getting curl to read the form parameters from a file (I'm not 100% sure, the manpage seems to suggest that -F can take a file source, but it might just be referring to how to upload an entire file?)


Nice work, thanks for documenting!

We've been very happy with the HelloFax (YC W11) service for some time now.

We pay $5/month for the once-every-few-months fax we get or send, but it still seems like a good deal for an official fax interface to the world. It's painless to use and has a pleasant web interface.


Thanks!

I was initially using eFax but their $16.99/mo fee was waaay too high for my usage, so then I tried to use HelloFax but their sign up form was busted. Ended up with Phaxio while searching for an API to power my own web-based fax app which never materialized after I found the email integration.


Note: Phaxio hasn't compensated me for this post. I'm just a happy small-time customer :)


Thanks for the write-up. This hits a serious pain point for anybody needing to interface with older institutions or businesses preferring fax as their main communication channel.

Appreciate the reminder of the OS X Preview signature signing capability!


+1 for the tip about capturing signatures in OSX Preview. That's a pretty cool feature that I had no idea existed.


Thanks. I have integrated with both Pamfax and Interfax, and neither really makes me happy. I will check this out in detail.

HelloFax is also a great service, but not comparable. It's for end users, not a programmable API.


I have been happy with Faxaway. I think my $10 payments each last me almost a year, given how much I use the service ($1/month plus $0.11 per minute sending in U.S., receive faxes for free). The interface is email: put fax phone number + '@fax2.faxaway.com' as recipient, 'FAXDOC' as subject, and attach pdf of document you're faxing. Works great.


We've been using myfax.com for $10/month and it works the same way. Hasn't failed us once in many years, but kind of pricy. Maybe worth considering a cheaper alternative.


I highly doubt that actually have "a whole bunch of fax machines" or even "banks of modems" anywhere. They are probably just using FreeSWITCH.


Just curious: how does one connect FreeSWITCH to POTS without "banks of modems"? I was under the impression that sending faxes over SIP was a Bad Idea(TM).


PRI interfaces with hardware or software DSPs are the "new" banks of modems.


Oh I had no idea FreeSWITCH lets you send faxes. That makes a lot more sense :)


Not only that, but sending a fax from your own freeswitch is a one-liner from the command line itself like this:

  fs_cli originate sofia/sipinterface/destination@privider &txfax(/fax.tiff)


Hylafax through IAXmodem with Asterisk will also do it. Asterisk will directly as well, but it's not as well put together.


I solved this issue with an obi200 + cheapo fax machine + google voice. I need a hardware solution because my non-techie wife needs to be able to fax without my help. I had a obi100 but it couldn't fax at all, so I sold it for a small profit (ha!).

I also got an email from Obihai recently saying that GV is discontinuing fax support, but so far it seems to continue working just fine, shrug.


I really like this guide. Also because it gives me a nice example of how to use an API with Python (I'm learning stuff). Much apprechiated!


Easily the coolest thing I've seen in a while.


On the one hand, this interests me because I am a unix user and I hate faxing so, so much.

But on the other hand, this just promotes faxing. Faxing needs to die, immediately. Nobody anywhere should be faxing anything for any reason, ever.

The only reasonable response to (anything to do with faxing) is this:

http://cdn.shopify.com/s/files/1/0042/9942/products/hatedeat...


Does Ruby not have a good HTTP library? Why would you ever shell out to curl?


Because I'm lazy, basically. I already had a working curl command, I just wanted to make it sanity check my arguments. Also, in my experience convincing the various Ruby libraries to do multipart form uploads (for the documents themselves) is sort of a pain (but if there's an alternative I would love to hear it!)


Sorry, can't make any Ruby suggestions. I spend more time in the Python world where we have requests[0], which makes it all dead simple.

For example, multipart file uploads looks like:

    files = {'filename[]': open(filename, 'rb')}
    data = {'to': to, 'api_key': api_key, 'api_secret': api_secret}
    response = requests.post(url, data=data, files=files)
[0]http://docs.python-requests.org/en/latest/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: