Twilio’s Quest to Offer All the APIs for Modern Day Messaging
If APIs are eating the world, as they say, Twilio is taking a bite out of engagement portion of this API world.
These days, Twilio might be best known as the service that Uber has been using to provide the SMS channel for drivers and riders to communicate with each other; It offers handy APIs that you can call in your code to make phone calls or send text messages without thinking about cellular providers or monthly minutes.
But over the last nine years, Twilio has gone from providing a handful of telephony APIs to offering a comprehensive set of communications and engagement services that you can plug into your code, or use together as a platform.
Twilio services fit in a sweet spot for developers between low-level protocols like SIP and WebRTC, platform and provider-specific services like Apple push notifications and Facebook Messenger, and the old-school telephony setups that are the antithesis of agile development and cloud services.
“I’m a developer. At every single company I started, I wanted to build things to communicate with my customers; I wanted the ability to write code to communicate with my customers,” Twilio CEO Jeff Lawson told The New Stack. “But every time I looked at how you’re supposed to do this, you get a bunch of application boxes, a bunch of PBXs, run a bunch of lines from the carrier. [You] plug in the gear and then bring in a professional services army to try and get it into commission and get it to try and do what you want. And every time you want to make a change you have to go back to professional services.”
The slow turnaround was as much of a barrier to innovation as the high costs. Once, Lawson was quoted $2 million for a system to allow customers to call in messages.
“It’s not designed to be a platform you can build on, it’s not designed for developers to realize new ideas. It’s the opposite of the software ethos, that idea that first of all you get something up and running, then you listen to customers and you iterate until you get it right; that’s the superpower of software,” he said. “But with the time it takes to make changes, it would be two years before I started getting feedback from my customers on whether the thing I built was useful to them. That’s crazy!”
API All the Things
Lawson’s view is that everything should be an API and that the APIs Twilio offers have to stick around as long as the services they work with do. “We’ve never killed an API,” he noted. But those APIs have built up into what he called a ‘programmable communications cloud’ on top of the communications network Twilio built, with a wide range of integrations to other services.
“We started with voice and SMS and we started layering on more carriers and we realized we’d built a network we could build APIs on top of, to control the flow of the call and give you a message flow, and insights, and a media engine for smarter content. And then developers built a layer of engagement on top of that,” he said.
Twilio can sell you SIM cards designed for Internet of Things devices that you can configure through Twilio’s cloud services, so when they arrive they’re ready to plug in and start sending back sensor data. That’s a U.S. service now with roaming but it’s coming to Europe and other geographies this summer. It has the Authy authentication service, which powers a new Android user verification service that combines push authentication for signup with checks on whether that user is on a real phone number or a VOIP line that might be used by a scammer.
There are APIs for fax as well as for video conferencing (including screen sharing between a small group or recording video rooms with up to 50 people in and detecting who the current speaker), or for monitoring the quality of voice calls (including whether the network is congested or the user has muted their microphone). Call controls can reroute calls that don’t get through to a shortcode to a full phone number, convert MMS messages to SMS format or redact PII in messages and handle opt-out processing for compliance.
The voice APIs add up to what Lawson called “programmable voice,” everything from dialing a phone number to handling a WebRTC connection, to conferencing other people in and recording the call. You can also monitor call quality and carrier connectivity.
Twilio’s media engine can already tell when your call goes to an answering machine (so you could switch from a live agent to having an API speak your own recorded message, correctly left after the beep), and it can do speech recognition (using Google’s voice recognition service, at 2 cents per recognition) and feed the results into a natural language understanding service.
“No matter what the channel is; voice or SMS, chat or Alexa or whatever, wherever customers talk to you Twilio will understand that. You train it once, you write your app once and you run it everywhere your customers may want to talk to you,” recognized Lawson said.
Noticing some common patterns for how developers use Twilio APIs led to building what Lawson dubs “declarative” APIs, which make up an “engagement cloud.”
“Most REST APIs are imperative, you’re sending commands. But sometimes you want best practices and common patterns. That’s why we pick development frameworks; because they allow us to focus on the building, not the plumbing,” Lawson said. “You tell us what you’re trying to accomplish and let us apply common patterns and best practices and do that for you. You get flexibility, but you also get to production faster.”
That approach led to APIs like:
- Notify: For sending notifications over multiple channels of communications including mobile and web push notification.
- Sync: For sharing state between devices or applications.
- Proxy: For putting two users in touch without revealing their private phone numbers.
- TaskRouter: For building call center flows.
Increasingly, Twilio is going beyond telephony because the way we communicate on our phones isn’t just voice and text; Channels is a new service that works with Notify, Proxy and Twilio’s SMS API to let you send messages to users on a range of services — everything from SMS and Facebook Messenger to Alexa notifications, Twitter DMs, Kik, Viber, WeChat, BlackBerry Messenger, HipChat and Slack, as well as SendGrid for email.
That list is going to get longer as new services arrive. “We built this really cool engine that allows you to do the complex configuration to onboard a new API for a new endpoint in days; when Facebook announces something when Google announces something, we’ll be able to incorporate these channels really efficiently,” Lawson explained.
It’s not just about connecting a new service thought; Notify also understands what you can do on different services.
“What we’ve done is build out abstractions for key types of engagement; there’s the one-to-zero use case, that’s notifications, there’s one-to-one, many-to-one, one-to-many. So a one-to-one conversation is Twitter direct messages, many-to-many is Slack, but these are interaction models that end up getting replicated on multiple services. The key is having the right abstractions to plug things into,” Lawson said.
You can use all of those directly in code, or through what Lawson referred to as the Twilio “runtime.” Stretching the usual definition somewhat, this covers the portal on the Twilio site where you can write code, with a built-in debugger, the new serverless Functions tool that abstracts away the usual infrastructure you’d use to run code with a visual programming interface that exposes all the other Twilio services. If you’re using the Chat API to build a chat system, Twilio now offers templates with user interface controls for design.
All this vastly simplifies communications on traditional telephony and across the mix of online tools and services where your users are, even if you only use a single API. Lawson was typically enthusiastic about the potential for developers; “A single developer can command power that entire nations didn’t have access to a few years ago.”
Feature image: Twilio CEO Jeff Lawson demonstrating speech recognition and language understanding on stage at the recent Twilio Signal conference. All images by Mary Branscombe.