In this guide we'll highlight a few of the key features of Add-ons and set you up to use them today. Let's dive in.
Installing an Add-on
Add-ons are enabled through the Twilio Console, and once installed, they enhance specific Twilio APIs, such as Twilio Voice and Twilio SMS. Two popular features from Add-ons are extracting information about a phone number's current owner, and ensuring a number is compliant with Telephone Consumer Protection Act (TCPA) regulations.
Let's first take a look at how to get the information about a phone number's current owner by enabling an Add-on for SMS called Ekata Reverse Phone. Inside the new Add-on catalog you can see all of the available API Add-ons. Select Ekata Reverse Phone from the catalog, on the first row.
Clicking on the Add-on gives you additional information, including a description and access to the product's documentation. The two things you need to know about on this screen are:
What APIs this will be enabled on — listed under
Supported Products
Whether or not the Add-on is
Installed
Go ahead and click Install . You can view all installed Add-ons by clicking on Add-ons > Installed .
Since we're interested in Lookups on a phone number in this scenario, check the Lookups box under the Configure tab.
Using the Ekata Add-on
The Ekata Reverse Phone Add-on is now enabled for Lookups, so we will use the Twilio Lookups API in order to get data about a target phone number. Here is the code:
Phone Number Information Retrieval with the Ekata Reverse Phone Add-on
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl
_10
// Download the helper library from https://www.twilio.com/docs/node/install
_10
// Find your Account SID and Auth Token at twilio.com/console
_10
// and set the environment variables. See http://twil.io/secure
Looking at the JSON response, we can see that the Lookup returned basic information about the phone number that we queried. Depending on the type of phone number found, different subsets of information may be returned, though these results are wrapped into a dictionary for you to access. More information on all the potential return values and dictionary keys can be found within the Add-ons marketplace.
Using the Prove TCPA Compliance Lookups Add-on
Another Add-on, Prove, protects your business from hefty fines levied under TCPA regulations for texting the wrong number. The Prove TCPA Compliance Add-on can quickly tell you if the number you are about to send an SMS to is active and still owned by your customer, with 100% reliability.
To use this Add-on we'll need to install it just like we did with Ekata Reverse Phone. Go to your Add-on catalog, locate and click on Prove TCPA Compliance, and click Install.
Since we want to leverage the Twilio Lookups API to find the TCPA Compliance information for a phone number, check the Lookups box under the Configure tab of the Prove TCPA Compliance Add-on. Afterwards, we are ready to query the TCPA Compliance information on our target phone number. Here is the code:
Deterministic TCPA Compliance with the Prove Add-on
Node.js
Python
C#
Java
Go
PHP
Ruby
twilio-cli
curl
_12
// Download the helper library from https://www.twilio.com/docs/node/install
_12
// Find your Account SID and Auth Token at twilio.com/console
_12
// and set the environment variables. See http://twil.io/secure
The results from the TCPA Compliance Lookup are wrapped into a dictionary, which contains the key NumberMatch, indicating Y for a compliant number, N for a non-compliant number, and I for an indeterminate number. The dictionary also has some keys related to the identification of the device claiming ownership of the number. If you're looking for demographic and carrier information, you can access it with the Ekata Reverse Phone Add-on.