In this guide we’ll cover how to combine Twilio Add-ons with Programmable Voice to use data from Twilio's partners in your Python web application. The sample code in this guide will use the Twilio Python SDK and the Flask web framework. Let's get started!
Twilio Add-ons are pre-integrated third party services that you can use with your Twilio application. Add-ons enhance the responses your application receives from Twilio by including additional data from Twilio’s partners.
Here’s an example that uses the Whitepages Pro Caller Identification add-on. When you enable this add-on in your Twilio Console, Twilio will include this data with its requests to your application for incoming phone calls.
The Whitepages Pro Caller Identification add-on gives your application more detailed information about the caller, like their name and address. But that’s just one add-on — there are more you can use from Twilio partners like IBM Watson and Wolfram Alpha, among others.
See the Add-ons Catalog for the complete list of available add-ons.
The first stop in using an add-on is your Twilio Console. Log in and navigate to the Add-ons page within the Marketplace section.
Then choose on the add-on you want to enable and click the “Install” button. In this example, we’ll use the Whitepages Pro Caller Identification add-on.
Once installed, be sure to check the box for “Incoming Voice Call” and click save. This will tell Twilio to use the add-on with incoming calls to your Twilio phone numbers.
Now we’re ready to use the extra data from our add-on in our Python application.
Twilio will include data from all of your add-ons in an “AddOns” field on requests it makes to your application.
This Flask application uses the data from the Whitepages Pro Caller ID add-on we configured above to tell the caller their name and what city we think they live in.
You can find a detailed specification of the data structure for an individual add-on within that add-on's page in the catalog.
And that’s it! Try giving your application a call to see your add-on in action. If you've never received a Twilio phone call with Python before, check out our guide on that topic.
We focused on the Whitepages add-on in this guide, but you can just as easily use any of the add-ons available in the catalog in your Twilio Console.