4 ms·
Command Line Faxing
- rsync 12y agoOn 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/hatedeath_det_medium.jpeg?v=1285423431 http://cdn.shopify.com/s/files/1/0042/9942/products/hatedeat...
- zrail 12y agoNote: Phaxio hasn't compensated me for this post. I'm just a happy small-time customer :)
- otoburb 12y agoThanks 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!
- jobu 12y ago+1 for the tip about capturing signatures in OSX Preview. That's a pretty cool feature that I had no idea existed.
- cpr 12y agoNice 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.
- zrail 12y agoThanks! 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.
- ef4 12y agoThanks. 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.
- hsitz 12y agoI 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.
- dergachev 12y agoWe'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.
- joosters 12y agoIn 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.
- zrail 12y agoYep, 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 https://github.com/lostisland/faraday [2]: http://docs.python-requests.org/en/latest/ http://docs.python-requests.org/en/latest/
- joosters 12y agoI 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?)
- sunsu 12y agoI highly doubt that actually have "a whole bunch of fax machines" or even "banks of modems" anywhere. They are probably just using FreeSWITCH.
- zrail 12y agoOh I had no idea FreeSWITCH lets you send faxes. That makes a lot more sense :)
- XorNot 12y agoHylafax through IAXmodem with Asterisk will also do it. Asterisk will directly as well, but it's not as well put together.
- vladimirralev 12y agoNot 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)
- cbhl 12y agoJust 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).
- tbyehl 12y agoPRI interfaces with hardware or software DSPs are the "new" banks of modems.
- tghw 12y agoDoes Ruby not have a good HTTP library? Why would you ever shell out to curl?
- zrail 12y agoBecause 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!)
- tghw 12y agoSorry, 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/ http://docs.python-requests.org/en/latest/
- jnankin 12y agoPhaxio 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.
- deleted 12y ago[deleted]
- latchkey 12y agoI 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.
- anarchoni 12y agoEasily the coolest thing I've seen in a while.
- tfrivold 12y agoI 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!