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 Miguel Grinberg
    Add Text Chat To Your Video Calls With The Twilio Conversations API Add Text Chat To Your Video Calls With The Twilio Conversations API

    If you implemented a video calling application using the Twilio Programmable Video API, you may find that during a call you want to share textual information with the other participants. This could be a link to a document, or even a reaction emoji. In this article you are going to learn how to take your video application to the next level by adding a chat room with the Conversations API.

    Video call with chat demo

    Tutorial requirements

    This is the third article in my series of Programmable Video tutorials, so we are going to take advantage of the video chat application built in the previous two installments and add the chat room feature to it. This application uses a vanilla JavaScript front end and a Python back end. To run this application on your computer you need the following requirements:

    • Python 3.6 or newer. If your operating system does not provide a Python …
    Read More
  • By Miguel Grinberg
    Build a Multi-Room Web Chat Application with Flask, React and Twilio Conversations Build a Multi-Room Web Chat Application with Flask, React and Twilio Conversations

    The Twilio Conversations API is a great way to build a unified messaging solution that works across SMS, MMS, WhatsApp, web and mobile chat. In this tutorial you will learn the basics of the Conversations API by creating a web chat application with support for multiple chat rooms.

    Project demo

    The main features of the application we will build are:

    • A Flask backend that logs users in.
    • A command-line interface to manage your chat rooms.
    • A Rect front end that allows your users to chat on the different chat rooms.

    Requirements

    To follow this tutorial you need the following components:

    • Python 3.6 or newer. If your operating system does not provide a Python interpreter, you can go to python.org to download an installer.
    • Node.js 14 or newer. Review the installation instructions for your operating system.
    • The Yarn package manager for Node.js. Review the installation instructions for your operating system.
    • A Twilio account. …
    Read More
  • By Miguel Grinberg
    Using the Twilio Python Helper Library in your Async Applications Using the Twilio Python Helper Library in your Async Applications

    If you are using an asynchronous web server with your Python application, you are bound by the first rule of async development, which is to never call functions that block. So what do you do when you need to use packages such as the Twilio Python Helper Library, which has no asynchronous version?

    In this article I’m going to show you some of the options that you have to safely integrate Twilio and similar clients with your async application.

    What is the problem?

    Before I go into the solutions, I thought it would be good to give a quick review of the issues with blocking in asynchronous applications.

    At the core of every async application there is the loop, an efficient task manager and scheduler that ensures that the CPU is shared as fairly as possible among all the running tasks. The type of multitasking used by async …

    Read More
  • By Miguel Grinberg
    Construa um Chatbot para WhatsApp com Python, Flask e Twilio Construa um Chatbot para WhatsApp com Python, Flask e Twilio

    Um chatbot é um aplicativo de software capaz de conduzir uma conversa com um usuário humano por meio de linguagem escrita ou falada. O nível de "inteligência" entre os chatbots varia muito. Enquanto alguns chatbots têm um entendimento bastante básico da linguagem, outros empregam algoritmos sofisticados de inteligência artificial (IA) e aprendizado de máquina (ML) para alcançar um nível de conversação quase humano.

    Nesse tutorial eu vou mostrar a você como é fácil construir um chatbot para Whatsapp usando a API da Twilio para WhatsApp e Flask framework para Python. Abaixo você pode ver um exemplo de interação com o chatbot:

    project demo

    Requisitos do Tutorial

    Para seguir esse tutorial você precisa dos seguintes componentes:

    • Python 3.6 ou mais recente. Se seu sistema operacional não tem um interpretador Python, você pode ir em python.org  para baixar o instalador.
    • Flask. Nós vamos criar uma aplicação web que responde mensagens vindas do WhatsApp. …
    Read More
  • By Miguel Grinberg
    The Ultimate Guide to OpenAI's GPT-3 Language Model The Ultimate Guide to OpenAI's GPT-3 Language Model

    Generative Pre-trained Transformer 3 (GPT-3) is a new language model created by OpenAI that is able to generate written text of such quality that is often difficult to differentiate from text written by a human.

    In this article we will explore how to work with GPT-3 for a variety of use cases from how to use it as a writing assistant to building a highly sophisticated chatbot. By the end you’ll know how to program GPT-3 to chat with you about your favorite topics. Here is an example short conversation I had with the bot about Python and web development.

    GPT-3 chat demo

    How good is it, really?

    Do you find it hard to believe that GPT-3 can generate text that is virtually indistinguishable from what a human writer can produce? I’m going to let you judge for yourself with another example.

    The following two paragraphs were generated by the GPT-3 engine to …

    Read More
  • By Miguel Grinberg
    Building a Chatbot with OpenAI's GPT-3 engine, Twilio SMS and Python Building an SMS Chatbot with OpenAI's GPT-3 engine, Twilio and Python

    A GPT-3 chatbot is a software application that is able to conduct a conversation with a human user through written or spoken language. The level of “intelligence” among chatbots varies greatly. While some chatbots have a fairly basic understanding of language, others employ sophisticated artificial intelligence (AI) and machine learning (ML) algorithms to achieve an almost human conversational level.

    In this tutorial I’m going to show you how easy it is to build a chatbot for Twilio SMS using the OpenAI platform and the Flask framework for Python.

    Want to have an idea of what the capabilities of GPT-3 are? Take a look at the following interaction I had with this bot using the project we are going to build in this tutorial:

    conversion with the openai chatbot

    Introduction to GPT-3

    GPT-3 (Generative Pre-trained Transformer 3) is a highly advanced language model trained on a very large corpus of text. In spite of its internal …

    Read More
  • By Miguel Grinberg
    Sending SVG Images by SMS and WhatsApp with Python and CairoSVG Sending SVG Images by SMS and WhatsApp with Python and CairoSVG

    Twilio Programmable Messaging makes it easy to embed images in text messages, but a notable omission in the list of supported formats is Scalable Vector Graphics (SVG). While SVG is not one of the most popular image formats, it is the preferred choice for generating diagrams and charts, because this format renders without quality degradation at any resolution.

    So what do you do if you have an SVG image and need to send it via SMS or WhatsApp? In this article I will show you how I use the CairoSVG package for Python to convert SVG images to the PNG format, which the messaging APIs support.

    Tutorial requirements

    The only requirement that you need for this tutorial is Python 3.6 or newer. If your operating system does not provide a Python interpreter, you can go to python.org to download an installer.

    Installing CairoSVG

    Let’s begin by creating a directory …

    Read More
  • By Miguel Grinberg
    Screen Sharing with JavaScript and Twilio Programmable Video Screen Sharing with JavaScript and Twilio Programmable Video

    The Twilio Programmable Video API allows you to build customized video chat applications on top of the WebRTC standard. In this article, I’m going to show you how to add a screen sharing option to a browser-based Programmable Video application built in JavaScript.

    Screen sharing demo

    Tutorial requirements

    In this tutorial we are going to add a screen sharing feature to the video chat application built with JavaScript and Python on a previous introductory tutorial. To run this application on your computer you need the following requirements:

    • Python 3.6 or newer. If your operating system does not provide a Python interpreter, you can go to python.org to download an installer.
    • A free or paid Twilio account. If you are new to Twilio get your free account now! This link will give you $10 when you upgrade.
    • A web browser that is compatible with the Twilio Programmable Video JavaScript library (see below …
    Read More
  • By Miguel Grinberg
    Automating Ngrok in Python and Twilio Applications With Pyngrok Automating Ngrok in Python and Twilio Applications with Pyngrok

    When you are developing an application that uses Twilio services you need to expose your webhooks on public URLs that can be reached by Twilio. If you have followed some of the tutorials that we published on this blog you know that we recommend using the excellent ngrok tool to generate temporary public URLs for your development web server. Ngrok is an incredibly useful tool that creates a tunnel from a URL on the ngrok.io domain to your application running on your computer. You can then configure your webhook using the ngrok URL and when Twilio sends a request to it, ngrok redirects it to your application.

    If you use ngrok frequently enough, it pays off to become a paid customer, which allows you to secure a permanent URL. But if you only use this service occasionally, it is tedious to have to log into the Twilio Console to …

    Read More
  • By Miguel Grinberg
    Using Test Credentials and Magic Phone Numbers to Test Twilio Applications Using Test Credentials and Magic Phone Numbers to Test Twilio Applications

    A common problem when developing an application that uses Twilio services is how to effectively test it. Making real requests to Twilio for testing purposes is something that can be useful when done sparsely, but it is not ideal as a general approach to testing because it can end up being expensive. Also, when testing how your application responds to errors you are going to find that it is very hard to replicate all the possible error conditions that can occur in SMS or Voice communication.

    In this article you are going to learn how to work with your Twilio Test Credentials to be able to send fake, yet realistic requests to Twilio that have a predictable result, and more importantly, are 100% free.

    Tutorial requirements

    To follow this tutorial you need the following components:

    • Python 3.6 or newer. If your operating system does not provide a Python interpreter, you …
    Read More
  • Newer
    Older
    Sign up and start building
    Not ready yet? Talk to an expert.