Level up your Twilio API skills in TwilioQuest, an educational game for Mac, Windows, and Linux. Download Now
Build the future of communications.
Start building for free
  • By Kelley Robinson
    How to Lookup a phone number with the Twilio CLI Lookup a phone number with the Twilio CLI

    Some bad actors use phone numbers from free online providers to create fake profiles to scam or spam. Twilio's Lookup API helps you identify the carrier behind the phone number to learn which users have real mobile numbers. And you can use it with the new Twilio CLI!

    Lookup a carrier with the Twilio CLI

    To lookup a phone number with the Twilio CLI you will need:

    Follow instructions to install the Twilio CLI then in your terminal log in with your account credentials found in the console:

    twilio login
    

    You can query the Twilio Lookup API for information about a phone number. There are two Types  of requests the API can perform:

    1. Carrier - includes line type (i.e. mobile, landline, voip) and telecom provider (i.e. Verizon, Level 3 Communications, Twilio)
    2. Caller name - includes caller identification information when available …
    Read More
  • By Kelley Robinson
    Why are the username and password on two different pages? Why are the username and password on two different pages

    The most common reason to put username and password on two different pages is to support both:

    1. single-sign on (SSO) (i.e. sign in with Google or a service like Okta)
    2. username/password login

    However, this login flow confuses people which is probably why you're reading this! Websites usually present a username and password field in the same view for us to log in. So you're not alone if you've ever wondered why the password field is missing or on another page.

    This post looks at the security of this design decision and presents options for designing login forms that support multiple paths of authentication.

    Is separating the username and password field onto different pages more secure?

    The separation could make credential stuffing attacks more cumbersome. It also allows the platform to perform conditional security checks. For example, the site can check if the account has enabled two-factor authentication and, if …

    Read More
  • By Kelley Robinson
    How to use Authy for Offline, Transaction Specific, PSD2 Compliant Authentication IUQz0LthtKSeMEB696SdzuWIk7cICH4sWkbTsXyU8Ea2tfSErofayxwYCm1YxPcy4_LfIAcrVFaG0xjk23I9foPpIoLA_-3rfakSeBOtsjBxs7Jto25FloIAkuCjPON1dbb8FPf_

    One of the best features about using Soft Tokens or Time-based One Time Passwords (TOTP) for authentication is that they are available offline. The European Payment Services Directive (PSD2) regulation requires Strong Customer Authentication (SCA) for all transactions over €30 by September 2019. Part of the regulation requires that SCA ties transaction-specific information to the authentication, called Dynamic Linking.

    This post will show you how to use a new feature of the Authy API and application to implement a compliant offline solution for your application. For more detail on PSD2, SCA, and dynamic linking, check out this post. You can also build SCA with push authorization or SMS, which we show in this blog post.

    Getting Started

    To code along with this post, you’ll need:

    Read More
  • By Kelley Robinson
    Who's Calling? How to Identify a Phone Number Carrier with Twilio Lookup blur-call-calling-1251088.jpg

    Some bad actors use phone numbers from free online providers to create fake profiles to scam or spam. Twilio's Carrier Lookup API helps you identify the carrier behind the phone number to learn which users have real mobile numbers.

    Lookup a carrier with Twilio

    To lookup a phone number you will need:

    You can query the Twilio Lookup API for information about a phone number. There are two Types  of requests the API can perform: carrier and caller-name. This example focuses on carrier.

    The following request will return carrier information about a phone number. The phone number in the request URL must be in E.164 format like +18557477626. Replace the credentials with your Account SID and Auth Token found in the console.

    In your terminal, run the following code:

    curl -X GET \ …
    Read More
  • By Kelley Robinson
    Detect Robocalls with Twilio Lookup and the Nomorobo Spam Score Add-on bG2utclWVzVcVomibKtYGe99wJ0WvTItH9LDAeHYR5JP7XJ9EjaiFHv1608ZZ0FvkJRbXMHiP_y13RhJczikwUygbOuZ8jld-ag8FNLEqAIx-4g1ArTDbPLqTYvFXroUaH1y9l42

    Twilio's CEO Jeff Lawson recently wrote about the history of robocalls and what we're doing to eliminate them. Until that happens, we can build a tool that will help us identify a robocall with a bit of Python, the Twilio Lookup API, and the Nomorobo Spam Score Add-on.

    Set Up

    In order to code along with this post you'll want to start with the following:

    1. Create a Twilio account
    2. Install Python 3
    3. Install the twilio-python helper library

    Head to the Twilio Console and install the Nomorobo add-on. Look for the yellow logo and click through to "Install".

    Leave the name as nomorobo_spamscore and "Save" the Add-On.

    Create a new file called nomorobo.py and add the following code.

    # Download the helper library from https://www.twilio.com/docs/python/install
    from twilio.rest import Client
    
    # Your Account Sid and Auth Token from twilio.com/console
    # DANGER! This is insecure. See http://twil.io/secure
    account_sid = 'your_account_sid'
    auth_token = …
    Read More
  • By Kelley Robinson
    What I Learned About Security from Calling 35 Contact Centers 0N_vQj4WWOs80HMrBU48yW3yOn7kzg37I_ILFKy5ifNW0R29Yzlx77PnmLQzENxj2uTf9xk8zGASigas5mL3un8biIBMF4UkBlDVE3dEnzzCqfnsf4uBNnLFV-_YK0F1rw_4PP-R

    Web applications often have secure login systems—maybe even 2FA—but what happens when a customer calls the customer support phone number? Security teams and app developers have thought a lot about online authentication, but haven't applied the same rigor to designing systems for authenticating over the phone.

    At Twilio, product and engineering teams have spent the last year thinking about this problem and how to make the experience better for both the customer and the call center agent. In that time, I've called dozens of contact centers to learn about how everyone from startups to Fortune 50 companies attempt to identify and authenticate the end user. This post will take a look at that research and outline best practices to use in call centers.

    🔍Research Parameters

    To test the over-the-phone authentication, I made a list of companies where:

    1. I have an existing account
    2. There is personal info tied to my account …
    Read More
  • By Kelley Robinson
    Identifying a Phone Number's Line Type with Twilio Lookup and Python clueless 1995 cell phone

    While the Twilio Messaging API won't charge you for attempting to send an SMS to a landline number, identifying the line type of a phone number can be useful for other reasons. A lot of businesses won't let users sign up with VoIP numbers, for example.

    This post will show you how to identify a phone number's line type with Twilio Lookup and Python.

    Set Up

    In order to code along with this post you'll want to start with the following:

    1. Create a Twilio account
    2. Install Python 3
    3. Install the twilio-python helper library

    Create a new file called lookup.py and add the following code.

    # Download the helper library from https://www.twilio.com/docs/python/install
    from twilio.rest import Client
    
    # Your Account Sid and Auth Token from twilio.com/console
    account_sid = 'your_account_sid'
    auth_token = 'your_auth_token'
    client = Client(account_sid, auth_token)
    
    phone_number = client.lookups.phone_numbers('+15108675310').fetch …
    Read More
  • By Kelley Robinson
    How to Build a Galentine's Day Compliment Generator with Python, Flask, and Twilio ann, you rainbow-infused space unicorn

    Happy Galentine's Day, you opalescent tree shark! The holiday dedicated to waffles and your best gal-pals only happens once a year, so I built an SMS-based bot that can generate compliments Leslie Knope would be proud of anytime. Send a text to (765) 234-3009 for a preview of what we're going to build in this short tutorial.

    Getting started

    Before we dig into some code, make sure that your Python and Flask development environment is setup. If you haven't done so already:

    1. Create a Twilio account
    2. Buy a phone number
    3. Install Python 3
    4. Install Ngrok to make your Flask app visible from the internet so Twilio can send requests to it
    5. Set up your Python development environment 

    If you're new to Python and Flask check out this handy guide for more information on getting started.

    We also need to install Flask to respond to incoming web requests.

    pip3 install …
    Read More
  • By Kelley Robinson
    PSD2 Compliant Authorization: Verifying Sensitive Actions with Python, Flask and Authy Screen Shot 2019-02-07 at 3.48.29 PM.png

    Adding two-factor authentication (2FA) to your login process increases the security of your user's data. We can extend that to validate sensitive actions like sending money from your account, changing your shipping address, or confirming a medical appointment. Even though the user should be already logged in with a username and password, we want to make sure that they authorize every payment. This blog post will show you how to secure payment actions using Python, Flask, a bit of Javascript, and the Authy API.

    PSD2 & SCA

    The European Payment Services Directive (PSD2) regulation requires Strong Customer Authentication (SCA) for all transactions over €30 by September 2019. This post will show you how to implement a compliant solution for your application. For more detail on PSD2, SCA, and dynamic linking, check out this post.

    The solution in this post is useful regardless of regulatory requirements. For example, …

    Read More
  • By Kelley Robinson
    What is Public Key Cryptography? 19DfiKodi3T25Xz7g9EDTyvF9di2SzvJo6JebRJaCN-1P_c1fMqGtrAyZzxGGucG0bcmR8UwNes-gSQUhQwsHxuApvTTq6vJGYAuMkURP6LqSwKeD-QTtOv6o6RMVxADID1QkCOy

    From TLS to authentication, “crypto” is used for a lot more than just currencies. Security should be part of every developer's toolkit and cryptography a fundamental building block for the libraries and tools we use to protect our data and applications. This post will dive into modern cryptography, an overview of how it works, and its everyday use cases — including how Twilio uses public-key crypto in our Authy application and to secure our API.

    Let's start with some context and history.

    Meet Alice and Bob

    Alice and Bob have a history of illicit dealings. We're not really sure what they're up to, but they don't want us, or the ever-curious Eve, to know. Before the internet, Alice and Bob could pass secret messages by encrypting text with an agreed upon cipher. Maybe that was through letter substitution or shifting or other sophisticated methods. They agreed …

    Read More
  • Newer
    Older
    Sign up and start building
    Not ready yet? Talk to an expert.