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 Michael Jaroya
    Creating a Daily Reminder WhatsApp App for Your Subscribers Creating a Daily Reminder WhatsApp App for your Subscribers

    For the longest time, the ideal way to keep track of subscribers was by creating an email list of all subscribers. However, due to the tremendous increase in the number of people using smartphones, and the introduction of Whatsapp and Whatsapp business, the tides have turned.

    Whatsapp, with over 1.5 billion active users in over 180 countries has revolutionized the way people communicate and consume information. Nowadays, users prefer real-time communications that are easy to consume which WhatsApp has achieved spectacularly. Most businesses have seen the potential and are now asking their users for phone numbers instead of email addresses. According to an article from Techcrunch, by mid-2018, 3 million companies were already using the WhatsApp Business app.

    In this tutorial, we are going to learn how to send a daily reminder to Whatsapp subscribers. This will be achieved by creating a Reminder app using Laravel, creating a REST …

    Read More
  • By Michael Okoko
    Improving PHP Code Quality with PHP CodeSniffer Improving PHP Code Quality with PHP CodeSniffer

    As a project grows, it becomes necessary to maintain and enforce some defined standards for the code. Such standards help achieve uniformity, readability, and maintainability, irrespective of the engineer that wrote the code. For a PHP project, one of the best ways to enforce such standards is PHP_CodeSniffer (or PHPCS for short).

    PHPCS is a tool that helps detect violations of pre-defined coding standards. It also includes an additional tool that can automatically correct those violations.


    To complete this tutorial you will only need Composer globally installed.

    About the project

    PHPCS is framework-agnostic, but for simplicity, we will be using it with a simple Laravel project. The project, called “Twilio Greeter”, displays a list of common greetings depending on the language chosen by the user. You can view the complete source code here.

    The project files that are of interest to us are:

    • PROJECT_ROOT/app/Http/Controllers/WelcomeController.php: Our main controller …
    Read More
  • By Tilde Thurium
    QR Codes And Security: A Shallow Dive QR-codes-security-shallow-dive

    QR codes have been referred to as “robot barf.” Which is too bad, because they’re pretty fascinating if you take a closer look.

    In this post, you’ll learn about:

    • History and inner workings of QR codes
    • Use cases and risks
    • How to generate QR codes in your application
    • How QR codes are used for two-factor authentication

    QR codes 101

    QR code is an abbreviation for Quick Response code. They’re a type of two-dimensional, or “matrix” barcode which means that information is stored across both the horizontal and vertical axes.

    QR codes were invented in Japan during 1994. They were originally used for tracking automobile parts. QR codes could store more data than UPC barcodes (the kind you commonly see on grocery store products and such), so they started to catch on in other industries as well. Denso Wave, the company that invented QR codes, made the spec …

    Read More
  • By Giuseppe Verni
    Add a Custom Chat Channel to Twilio Flex flex-custom-chat-channel.png

    In this post, I'll show you how to add a custom chat channel, such as Socket.IO, into Twilio Flex. There are several different ways to integrate a custom channel, but in this article, we will look at the one that doesn't require the development of an additional Flex UI plugin.

    Prerequisites to Add a Chat Channel to Twilio Flex

    Before we can start, you'll need to make sure you have a few things set up.

    Custom Socket.IO chat in Flex

    After that, you're ready to chat – let's look at the message flow.

    Adding a Chat Channel in Flex

    Before digging into how a custom chat can be integrated, we need to understand the flow a message goes through before appearing in the Flex UI. Let's …

    Read More
  • By Maciej Treder
    Asynchronous JavaScript: Using RxJS Observables with REST APIs in Node.js Async JS RxJS Observables Node js

    ReactiveX is an electrifying programming concept. It’s widely adopted in popular programming languages, including JavaScript. ReactiveX programs can react to data as it is emitted from a source, rather than get the data from it. This is a convenient way of handling data from sources like web APIs or WebSockets.

    In this post you’ll get hands-on experience doing ReactiveX programming with RxJS: ReactiveX for JavaScript. You’ll learn how to perform REST API calls to retrieve data asynchronously, manipulate it as it arrives, and perform subsequent calls based on the emitted data. You’ll also see how to perform other actions whenever data is emitted by an Observable.

    This post focuses on how to utilize RxJS Observables with REST API calls. The previous post in this series on Asynchronous JavaScript explains RxJS fundamentals:

    Understanding the case study project

    In this post you will see how …

    Read More
  • By AJ Saulsberry
    Validating Phone Numbers Effectively with ASP.NET Core 3.1 Razor Pages Validating Phone Numbers Effectively In Razor Pages

    Data validation is an essential part of application design and development, and telephone numbers are as tricky to validate as they are ubiquitous. In many cases a phone number will be the primary way your organization communicates with its customers. Whether the communication will be by voice, SMS, or messaging app, having a correct phone number is a requirement.

    Developers using .NET Core and the .NET Framework can do validation for a number of different data types, including phone numbers, with the System.ComponentModel.DataAnnotations namespace, but the PhoneAttribute class has its limitations. To learn more, see the .NET Data Validation section of the previous Twilio Blog post on this subject: Validating phone numbers effectively with C# and the .NET frameworks.

    Fortunately, the libphonenumber-csharp open source library provides extensive resources for validating and manipulating phone numbers of all types and it’s conveniently available as a NuGet package. This post shows …

    Read More
  • By Philip Kiely
    Build an Email Newsletter with Django and Twilio SendGrid Build an Email Newsletter with Django and Twilio SendGrid

    In recent years, email newsletters have become an increasingly popular way for content creators to reach their audiences. In software development, newsletters from Sacha Greif’s Sidebar to the now multi-line Cooper Press have found success distributing curated links and original articles. A number of services exist to solve the myriad of technical and non-technical barriers to reliably distributing to a large mailing list, including Twilio SendGrid’s own official solution and resources on starting a newsletter. While what we develop in this tutorial may not be as fully-featured as the off-the-shelf product, today we’ll take a dive into creating our own minimal email newsletter backend using Python’s Django Web Framework and Twilio SendGrid’s core email-sending API.

    Tutorial Requirements

    To complete this tutorial, you’ll need the following:

    • Python 3.6 or newer. If you don’t have a previously installed Python interpreter, you can go to python.org to download an installer. …
    Read More
  • By Miguel Grinberg
    Push Two-Factor Authentication in Python with Twilio Authy Push Two-Factor Authentication in Python with Twilio Authy

    Two-Factor Authentication (2FA) is one of the most effective ways to increase the security of online accounts and consequently reduce online identity theft. The 2FA implementation used by most applications is based on the Time-based One-Time Password algorithm, which requires users to read a numeric code from a hardware token generator or smartphone app and enter it on an application’s website to confirm their login attempts.

    Unfortunately, many users find this extra login procedure tedious and inconvenient. There have been efforts to simplify the 2FA flow with the goal of increasing adoption.

    A new method that is gaining popularity is Push Authentication, where instead of expecting a numeric code, the application server sends a push notification to the user’s smartphone. The only action for the user is to tap a button in this notification to confirm that the login attempt is legitimate.

    In this article, I will go …

    Read More
  • By Brian Iyoha
    Building an Order Tracking System in Laravel Powered by Twilio SMS Building an Order Tracking System in Laravel Powered by Twilio SMS

    In today's world where online shopping is at an all-time high, the chances of your e-commerce site standing out are going to be based on how much you can get your customers to trust in your service(s) and the level of satisfaction gotten from using them. One way of improving customer satisfaction and "trust" in your online shop is by allowing your customers to gain knowledge about the current state of their package.

    An order tracking system will allow your customers to gain more information about the current status/location of their package. Doing this will help increase the satisfaction of your customers, as they too will have detailed insight into where their package is at any given point in time until it arrives at their desired location.

    In this tutorial, you will learn how to use Twilio’s Programmable SMS to create an order tracking system using Laravel and update users …

    Read More
  • By Parry Cadwallader
    Build a WhatsApp Flashcard Bot With Python, Flask and Twilio Build a WhatsApp Flashcard Bot with Python, Flask and Twilio

    A flashcard is one of the most tried and true study tools, helping anyone from medical students to language learners all approach their goal of memorizing facts and figures. Software like Anki or Memrise have provided countless features and robust settings that make digital flashcards increasingly useful. However, there are plenty of times where you might not be able to pull up one of the more robust applications and need something more lightweight to study with.

    For example, when your cell signal is good enough for texting, but cannot load a full-featured web application. Or perhaps you’re in an airplane that doesn’t allow various websites, but does allow you to text phone numbers down on the ground.

    This tutorial will show you how to make a basic flashcard bot for WhatsApp or SMS to get you started on your way to reviewing flashcards wherever you are. You can see an …

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