How HipChat works: SMS chat with Twilio

| April 21, 2010

Earlier this week we released a mobile alerts feature allowing users to hook up their cell phones and participate in one-on-one chats while away from the computer. Having SMS support is important to us because just about everyone has a cell phone but not necessarily a smart phone capable of running our web chat. Adding SMS support turned out to be quite simple thanks to Twilio. Here’s why:

1. Cost – At first we thought we’d have to use short codes to send our messages. They’re the 5 or 6 digit numbers you can text vote on American Idol, get crappy ringtones, etc. Unfortunately they’re about $500/mo each (and some companies will charge you much more). We also looked at using a shared short code but you can’t do two-way SMS (send and receive) with them. Twilio lets you use local numbers for $1/mo that can send up to 1 message per second. This means we can just add more numbers as our volume increases. Finally, each message (in or out) is just $0.03.

2. Setup speed – It takes about 90 days and a bunch of approvals to get a short code, probably because you can use them to charge people monthly fees. Allocating a local number on Twilio takes about 15 seconds (even less if you do it through their API).

3. Two-way messaging – We need to be told about replies to the messages we send so mobile users can actually have conversations. We also need to use a different phone number for each chat session you have so that we know who you’re replying to (that’s where the short codes get really expensive). Twilio will hit a URL we provide with information about each incoming SMS so we can deliver them to the right person.

Note: If you’re just doing low-volume one-way messaging you can probably get away with email-to-SMS gateways.

4. Clean API – Twilio’s REST API is easy to use, and has a PHP library available. We just wish they had JSON support. By the way, we’re getting really close to releasing our own API!

5. Good support – They were far more helpful and responsive than other SMS gateway providers. We had the feature built and working in about 2 days.

We hope everyone enjoys the new SMS chat feature and that some of you will have the pleasure of adding SMS (or voice) support to your own app.