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

Code, Tutorials and Hacks

  • By Miguel Grinberg
    Play Chess with a Friend on WhatsApp using Python and Twilio Play Chess with a Friend on WhatsApp using Python and Twilio

    While most of the world is under some form of stay-at-home orders to prevent the spread of COVID-19, we are constantly looking for new ways to entertain ourselves and remain connected with family and friends.

    When I was little I used to play chess a lot, so now that I have additional time on my hands I decided to start playing again. The thing is, nobody in my immediate family plays chess, so I had this idea of using WhatsApp to play a game of chess against a remote friend.

    Chess game demo

    By the end of this tutorial you will know how to use the Twilio API for WhatsApp to implement a turn-based game that requires sending messages and images between multiple participants. You will also learn about how to manage a game of chess in Python, but even if chess isn’t your thing, you will be able to replace the chess …

    Read More
  • By Lizzie Siegle
    Pose Detection in Twilio Video with TensorFlow.js Detect Poses TensorFlow.js header

    Pose detection is one fun and interesting task in computer vision and machine learning. In a video chat, it could be used to detect if someone is touching their face, falling asleep, performing a yoga pose correctly, and so much more! 

    Read on to learn how to perform pose detection in the browser of a Twilio Video chat application using TensorFlow.js and the PoseNet model.

    Join Room.png


    To build a Twilio Programmable Video application, we will need:

    Follow this post to get setup with a starter Twilio Video app and to understand Twilio Video for JavaScript a bit more, or download this repo and follow the …

    Read More
  • By Imran Khan
    Build a Live Traffic WhatsApp Chatbot with Python, Flask, Folium and Twilio Build a Live Traffic WhatsApp Chatbot with Python, Flask, Folium and Twilio

    Like most people I am endlessly frustrated by sitting in slow-moving traffic and I often wonder if I just got unlucky or is it always like this?  In this tutorial I’m going to show you how to answer that question by building a basic chatbot for WhatsApp using the Twilio API for WhatsApp and the Flask framework for Python.

    The chatbot will allow users to share their current location and get back a live traffic report and a link to an interactive map.  Here’s an example showing how it works:

    traffic chatbot demo

    Tutorial requirements

    To follow this tutorial you will need the following:

    • Python 3.6 or newer.  You can download an installer from python.org.
    • ngrok. We will use this free utility to connect our Flask application running on our local system to a public URL that Twilio can connect to from the Internet.  Installation instructions for your operating system can …
    Read More
  • By Jeff Rosenthal
    Getting Started with gRPC in .NET Core getting-started-with-grpc (1).png

    As a developer in the 21st century, you are often faced with addressing communications between various modules of your project. Internal, or “intra-process” communications, are often handled with loosely coupled messages, but forging beyond the process boundary can often be challenging. Adding to this requirements for scalability, testing, and security can often leave you scratching your head in search of a better way.

    Over the years Microsoft has often revealed various technologies to handle this niche. Remote Procedure Calls (RPC), DCOM, Named Pipes, and Windows Communication Foundation (WCF) are examples of technologies that have fit the bill in the past. A new technology is now making the scene, this time with the assistance of Google.

    For over 10 years now, Google has implemented an infrastructure to interface the vast number of microservices it oversees. In 2015, they set out to create the next version of this technology and shared what …

    Read More
  • By Liz Moy
    Build a Survey App With Python, Twilio, and Airtable Build a Survey App With Python, Twilio and Airtable

    "Scandia 010" by How I See Life is licensed under CC BY-ND 2.0

    Airtable is like a cool big-budget superhero crossover between a spreadsheet and a database.

    It’s easy to write to an Airtable from your Twilio app, so we’re going to take that idea and build off of it to make a SMS-driven survey app using Python and the Flask framework.

    The survey app we are going to build will gather NPS, which stands for Net Promoter Score, a metric used to measure customer experience. However, you can customize the survey for purposes specific to your needs. Try it out by texting your favorite emoji to the number below.

    Airtable NPS survey testing number with Twilio

    We’ll go through this step-by-step, and we will do it all in a single file. If you would like to download the complete project you can find it in this GitHub repository: https://github.com/Eclairemoy/nps-survey

    Building the Project


    To …

    Read More
  • By Shane Rosenthal
    Quick Introduction to Anonymous Blade Components In Laravel 7 Quick Introduction to Anonymous Blade Components In Laravel 7

    Laravel 7 introduced not only a new syntax for Laravel Blade components, but some awesome new features that can greatly enhance your development by increasing your productivity. This tutorial will provide a brief overview of the new Anonymous components in Laravel 7, by teaching you how to create dynamic, reusable form fields.


    Before you begin this tutorial, make sure you have the following set up/installed:

    • A Laravel 7 application already installed
    • General knowledge of Laravel and Blade components

    What We’ll Build

    We’ll put together a simple, profile-like form, and then extract data from the Blade components. I will be using Tailwind CSS for the styling which for your reference, can be brought in through their CDN. Create a new folder and layout located at resources/views/layouts/main.blade.php. Add the following code to the newly created file:

    <!DOCTYPE html>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Laravel 7 …
    Read More
  • By Ladapo Samuel
    Send an Email Using Twilio SMS in PHP with SendGrid Send an Email Using Twilio SMS in PHP with SendGrid.png

    One of the most amazing and forgotten features of SMS is that it works with no internet access. If you’re one of the 3.5 billion people in the world that uses a smartphone, you might not be aware of the millions that don’t use their finger to swipe their screens. India alone accounts for 400 million feature phones still in use in the world.

    This might be hard to imagine, but assume you’re in a tight situation and you need to send a quick email and have no internet access. Maybe it’s a job posting you saw or an opportunity that can’t wait until you reach your laptop. It would be helpful if you could still send an email using SMS! In this tutorial, we’re going to learn how to do just that; send email using SMS.

    Technical Requirements

    Your computer will need to be set up to with …

    Read More
  • By Ugendu Ositadinma
    Create a Twilio Voice Pricing Calculator using PHP Create a Twilio Voice Pricing Calculator using PHP

    A major concern when building web solutions with third-party services is estimating the costs of API requests. This tutorial will guide you through the process of finding the costs of voice calls for Twilio Programmable Voice, depending on the origin and destination.

    Installation Requirements

    Getting started with this tutorial, it is expected that you have the following modules/packages installed on your development machine:

    Here is a guide that can be followed to  install Composer globally:

    Creating the PHP project

    Let’s create a folder named pricing on your local machine where the code will be housed.

    Inside this folder, create an index.php file which will contain all the code for this tutorial.

    Next, proceed to install Twilio's PHP SDK to call the necessary APIs needed for the functions to be shared. To achieve this, use Composer to install …

    Read More
  • By Luce Carter
    Using Data Binding in Xamarin Applications using-data-binding-in-xamarin.png

    Xamarin is a powerful tool for building cross platform apps for Android and iOS devices. You can use Xamarin without leaving the comfort of your Visual Studio development environment and you don’t have to buy and connect a bunch of mobile phones to test your apps: Xamarin includes emulators to give you a real feel for how your user interface will look and work.

    One of the time-saving and powerful aspects of Xamarin is Xamarin.Forms, a toolkit for building user interfaces with eXtensible Application Markup Language (XAML) to define how a user interface component in a Xamarin app will look and behave. Xamarin XAML (try saying that five times fast) works in concert with code-behind C# classes, a structure you may be familiar with if you’ve worked with ASP.NET or ASP.NET Core.

    Xamarin.Forms includes Data Binding, a way of keeping a user interface synchronized with its underlying data without …

    Read More
  • By Chimezie Enyinnaya
    Build A Group Chat With Admin Moderation In Laravel Using Twilio Programmable Chat Build A Group Chat With Admin Moderation In Laravel Using Twilio Programmable Chat

    In this tutorial, I’ll be showing you how to build a Laravel group chat application with admin moderation using Twilio Programmable Chat.


    In order to follow this tutorial, you will need the following:

    What We’ll Be Building

    For the purpose of this tutorial, we’ll be building a group chat, where an admin will be able to perform the following tasks:

    • Ban members in a group
    • Unban members in a group
    • Remove members from a group

    Getting Twilio Credentials

    Login to your Twilio dashboard and copy both your Account SID …

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