Build the future of communications.
Start Building for Free

Code, Tutorials and Hacks

  • By Calum Muir
    Operate Globally with Twilio Regions and Edge Locations Operate Globally with Twilio Regions and Edge Locations

    Twilio is a world leading CPaaS (Communications Platform as a Service), and that means that we have to operate on a global scale to provide our customers with the best experience, both from a technical but also a regulatory view. To do this, we have to have infrastructure situated in data centers around the world, allowing our customers the flexibility to optimize their applications according to their customer base.

    To take advantage of this global infrastructure, there are two parts of the Twilio platform that customers should familiarize themselves with; Twilio Regions and Edge Locations.

    Twilio Regions

    Local Data Processing And Storage in EU

    At Twilio, we realize that the transfer of EU personal data to the US and other third countries might be an area of concern for privacy conscious EU citizens and EU data protection regulators. As part of our ongoing data privacy efforts, and since the Schrems …

    Read More
  • By Muyiwa Femi-ige
    How to Automate WhatsApp Messages using Bottle and Twilio Header image for automating whatsapp messages with bottle and twilio tutorial

    Automation is not a new topic in Python. In fact, it is one of the most widespread use cases of Python. To automate is to reduce the need for human intervention by implementing countermeasures or "future" actions that will be in effect for a particular task.

    Automation has a general use, but we will give an insight into its process by showing how to automatically send WhatsApp messages using the Twilio services and Bottle web framework in Python.

    Prerequisites

    This project will show you how to expose a local server to the web using Localtunnel dynamically and how to use a URL as a callback in the Twilio Sandbox for WhatsApp. Thus, you will need the following to achieve this aim:

    Let us begin!

    Getting started

    This section will talk about the following:

    1. Setting up the Twilio WhatsApp Sandbox.
    2. Sending an HTTP …
    Read More
  • By Kelley Robinson
    How to filter landlines before sending SMS with the Lookup API How to filter landlines and other undeliverable destinations before sending SMS

    You successfully created a text message but shortly after received the unfortunate [Twilio Alert] On 1st error each day email. Maybe it was a 30006 - Landline or unreachable carrier or other undelivered message error. If you're lucky, your application handles status callbacks for undelivered messages.

    What if there was a way to catch undeliverable messages proactively? This blog post will walk you through using the Lookup API to determine line type, so that you can filter landline numbers before sending an SMS to them (and being charged for that SMS).

    Console screenshot showing error 30006

    How to determine if you have undelivered messages

    Twilio uses status callbacks to track message delivery status with webhooks. Learn more …

    Read More
  • By Reshma Sathe
    Schedule a NASA Astronomy Picture of the Day SMS with Python, Django, and Twilio Schedule a NASA Astronomy Picture of the Day SMS with Python, Django, and Twilio

    Astronomy has always been a fascinating subject and has always piqued my interest. I found the NASA Astronomy Picture of the Day and their API during my search. That's when I thought of creating an application that would send me an SMS with the latest picture of the day from the NASA APOD API.

    Instead of reinventing the wheel, I used Twilio SMS, Django, Celery, and the NASA APOD API to create my application. The goal was to:

    • Get a response (astronomy picture of the day and its related information from the NASA APOD API,
    • Create and send an SMS to selected phone numbers using Twilio, and
    • Schedule the SMS to be sent every day at 10 am local time.

    The complete code is available in this repository.

    Prerequisites

    • Python 3.6x or 3.7x. If your operating system does not provide a Python interpreter, you can download …
    Read More
  • By Miguel Grinberg
    A Privacy-First Web Analytics Solution with Twilio Segment A Privacy-First Web Analytics Solution with Twilio Segment

    If you own or manage a website, you likely spend a decent amount of time trying to identify the patterns and trends in how visitors interact and engage with your site. This information is invaluable when trying to improve user experience and attract more visitors. Web analytics services such as the popular Google Analytics make it easy for website administrators to collect large amounts of information about visitors in real time, just by adding a <script> tag to the site’s HTML.

    The problem is that in their quest to provide more and more information, analytics tools have become too invasive, installing their cookies on users’ devices with the purpose of tracking browsing habits and preferences, and even following users as they move through different websites. This has become such a problem that in many parts of the world there are now regulations to protect the online privacy of users. In …

    Read More
  • By Niels Swimberghe
    How to generate TwiML using Strings in C# Generate TwiML using Strings in C#

    Over the decades, C# has added different ways to create a string, each with their own benefit. In this tutorial, you'll learn how to generate TwiML using the different C# string features with an ASP.NET Core Minimal API and compare it to the object oriented way of generating TwiML.

    But first, let's get you up to speed on how Twilio uses webhooks and TwiML to respond to text messages and voice calls.

    Prerequisites

    Here’s what you will need to follow along:

    Read More
  • By Mia Adjei
    Build a Digital Sticky Notes App with Flask and Svelte Build a Digital Sticky Notes App with Flask and Svelte

    Sticky notes are a great tool for organizing your thoughts or keeping track of things you need to do.

    If you are a student, or anyone thinking about a lot of things at once, there are tons of ways a sticky note could help you out. You can write down the things you need to remember to do, the items on your back-to-school shopping list, notes about what you're learning or thinking, and so much more.

    If you enjoy using paper sticky notes, perhaps you might also be interested in giving digital sticky notes a try. In this tutorial, you'll learn how to build a digital sticky notes application, using Python and Flask for the backend API, JavaScript and Svelte for the UI, and Twilio Sync to store the notes.

    Prerequisites

    Read More
  • By Niels Swimberghe
    Use Raw String Literals to generate TwiML in C# 11 Use Raw String Literals to generate TwiML in C# 11

    Over the decades, C# added different ways to create a string, each with their own benefit, and C# 11 is adding another way: Raw String Literals. There are many use cases for Raw String Literals, and one of those use cases is to generate TwiML, but more on that later. In this tutorial, you'll learn how to generate TwiML with Raw String Literals with an ASP.NET Core Minimal API.

    Prerequisites

    Here’s what you will need to follow along:

    Read More
  • By Matthew Setter
    How to Build a Command Line Application (CLI) to View Your Twilio Account Usage How to Build a Command Line Application (CLI) to View Your Twilio Account Usage

    Building APIs and web-based applications are the mainstays of what we as web developers do. However, command line applications are also an essential skill to master. They help us do what we do more effectively and easily, such as by allowing us to build small tools and utilities to help us with routine, repetitive tasks.

    In this tutorial, I'm going to show you how to use Symfony's Console Component to build a command line application that can retrieve usage records from a Twilio account.

    Prerequisites

    To follow along with this tutorial, you will need the following:

    Create the project directory structure

    The first thing to do is to create the core project directory structure (to aid in …

    Read More
  • By Miguel Grinberg
    A Great Looking Star Ratings Chart for your React Application A Great Looking Star Ratings Chart for your React Application

    Every blog post and documentation page on the Twilio website lets readers rate the content with a 1 to 5 star rating. But what do we do with these ratings? We actually track them using an in-house tool, along with other content-related metrics. Initially, this tool showed the average rating for each page as a decimal number, but we soon realized that showing just a number is not sufficient. Our documentation pages, for example, are constantly being expanded and improved, so it is useful to see how the more recent ratings fare against the older ones.

    I hoped to find a star ratings chart component for React that can show star ratings in greater detail, but sadly I could not find any. In fact, I could not even find good examples of sites that visualize their star ratings categorized by their age. In the end, I designed and built my …

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