Table of Contents
It’s the new year! Why not kick 2017 off with a side project? We’re wrapping up our #12DaysOfAPIs series that profile cool APIs to test. Today, we’re covering Twilio’s primary messaging and voice call API.
What is the Twilio API and what can I do with it?
Twilio is the dominant API company when it comes to texting and voice calls.
Rather than build an app’s text functionality from scratch, you can use the Twilio API to send text (or multimedia) messages. Similarly, if you need to programmatically make actual phone calls, Twilio lets you integrate real-time phone calls into applications.
While Twilio offers multiple APIs, we broke down the various functionalities into two API packages:
- Primary API: Allows you to send text (SMS) and multimedia(MMS) messages, as well as make phone calls.
- Copilot API: Programmatically generates phone numbers from a user’s local region and sends messages to larger audiences. Works with the primary Twilio API as a copilot (hence the name!) to deliver messages at scale.
Twilio’s primary API is likely where you will start any side project, while the Copilot API is more useful for scaling an existing project. We have packages for both APIs on our marketplace, so that you can make test calls from within your browser (more on how in a bit). Check them out here (Twilio, Twilio Copilot).
Use cases for Twilio’s Messaging and Voice API
One of the things we love about Twilio’s API is its ubiquitous use cases.
The most obvious use case for Twilio is the text messaging feature (aka the
sendMMS endpoints). Texting is the most widely used app on smartphones, with 97% of Americans using a text app at least once a day. It’s no wonder that developers are incorporating text messages more and more into their scripts.
Here are some of the many ways that developers are incorporating Twilio’s texting functionality into their programs:
- Two-factor password verification: Say you want to make your project extra secure. You can use Twilio to provide a two-factor password verification check with a text message.
- Delivery and geo-targeted notifications: Want to update someone in real-time about a delivery or pick up? Twilio does that too–just ask Uber. The delivery giant uses Twilio to send real-time updates about pick-ups and driver information.
- Text-to-donate functionality: Paging all non-profit developers! The Twilio API also can power “text to donate” prompts.
As for the voice side of things, Twilio has some interesting case studies on the phone side as well. For example, the Democratic National Committee used the Twilio voice API to power their voter hotline.
How to use the Twilio API
1. Set Up: Getting the Twilio Credentials
Now that we’ve given you all these project ideas, we bet you’re anxious to get started. You can make Twilio API calls right within your browser using our API package.
The Twilio API package is relatively easy to use with only three endpoints (
sendMms). However, to use the Twilio API, you have to get an account and a number of account details (
messagingSID and a Twilio phone number). Getting these details can be a little complicated, so we wrote a tutorial. Check it out here to get set up.
2. Scaling the Twilio API: Free and Paid models
The Twilio API has a pay-as-you-go pricing model (for when you actually want to invite users to your app), but also offers a free developer testing environment. The developer model allows you to get a Twilio phone number for making a phone call and sending text or multimedia messages to one phone number.
In that project, we could send GIFs from a Twilio phone number to a single developer phone number. The free developer account let us send the multimedia message to the single developer phone number, but not any others (which would require payments).
Side project ideas
Like we said, you can do a lot with the Twilio API, but pairing it with other APIs really takes it to the next level. RapidAPI lets you call multiple APIs through one portal. Here are some projects you could build with the Twilio API through RapidAPI:
- Pair the Twilio API with the YahooWeatherAPI to get the forecast via text
- Text the attendees of an event by pairing Twilio with the Eventbrite API
- Send real estate listings via text with the Zillow API
- Build a texting chatbot with Wit.AI or APIAI
Need more ideas? Browse all the APIs on the marketplace here. Let us know what you build in the comments below!