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 Tilde Thurium
    Découvre 7 APIs cools et insolites! 7-api-cool-banner

    Les êtres humains apprennent mieux en jouant.

    Peu importe votre niveau, débutant ou habitué, cet article vous donnera 7 APIs drôles et absurdes avec lesquelles vous amuser !

    Si vous n’avez jamais écrit une ligne de code, ne vous inquiétez pas ! Nous vous montrerons comment ça fonctionne. Pour les plus expérimentés, n’hésitez pas à passer directement à la partie “Les 7 APIs à découvrir” ;)

    C’est quoi une API?

    API est l’acronyme de “Application Programming Interface” (Interface de Programmation d’Application). C’est une méthode de communication entre deux programmes. Ils peuvent être exécutés à partir du même ordinateur ou non, ça n’a pas vraiment d’importance.

    Il y a plusieurs types d’APIs - le terme est très large. Aujourd’hui nous allons nous concentrer sur les APIs REST.

    Les APIs REST suivent un pattern qui définit comment l’information sera transmise d’un ordinateur à un autre. Celui qui demande la data est appelé …

    Read More
  • By Miguel Grinberg
    How to Send a Picture on WhatsApp from the Command Line Using Twilio and cURL How to Send a Picture on WhatsApp from the Command Line Using Twilio and cURL

    The WhatsApp Business API from Twilio is a powerful, yet easy to use service that allows you to communicate with your users on the popular messaging app.

    In this article, you’ll learn how to send an image to a user through WhatsApp using a cURL, which would make this functionality accessible from shell scripts.

    Project demonstration

    Prerequisites

    To follow this tutorial you need the following items:

    The …

    Read More
  • By Carlos Mucuho
    Make and Receive Phone Calls from the Browser with Twilio Programmable Voice, Python and JavaScript Make and Receive Phone Calls from the Browser with Twilio Programmable Voice, Python and JavaScript

    In this tutorial, we are going to write an application that uses the Twilio Programmable Voice API to make and receive phone calls from a web browser. We will also implement a UI that allows us to make, accept, and reject phone calls.

    By the end of this tutorial we will have an application that looks like the following:

    Project demo

    Tutorial requirements

    To follow this tutorial you are going to need the following components:

    • A free or paid Twilio account. If you are new to Twilio create a free account now. If you create your account using this link and later upgrade to a paid account, you will receive $10 in credit.
    • A Twilio phone number capable of making and receiving phone calls. Get one now if you don’t have it.
    • Python 3.6+ installed.
    • ngrok installed. ngrok is a reverse proxy service that creates a secure tunnel from a public endpoint …
    Read More
  • By Diane Phan
    How to Receive WhatsApp Messages in Python Using Flask and Twilio header - How to Receive WhatsApp Messages in Python Using Flask and Twilio

    The WhatsApp Business API from Twilio is a powerful, yet easy to use service that allows you to communicate with your users on the popular messaging app. In this tutorial you are going to learn how to create a Python application based on the Flask web framework that can receive and handle WhatsApp messages.

    Project demo

    Prerequisites

    To follow this tutorial you need the following items:

    The Twilio WhatsApp sandbox

    Twilio provides a WhatsApp sandbox, where …

    Read More
  • By Paul Kamp
    Personalize SMS Marketing Communications with Twilio and Segment personalize SMS Twilio Segment

    Personalized communications are powerful. The right message, at the right time, on the right channel is the difference between a customer for life – and a lifelong detractor. Whether you're in real estate, medicine, finance, retail, or really any industry, timely and useful communications are essential to keep your customers happy.

    This post will show you how to personalize an SMS to a customer on an e-commerce page using Segment and Twilio Programmable Messaging.

    Let's build something timely!

    Prerequisites

    Before we get started, you'll need to sign up for a few accounts.

    And with that, let's get started!

    Set up a source in Segment

    With Segment, you create a source for every site or app (or device!) you'd like to track …

    Read More
  • By Matthew Gilliard
    How to send SMS at scale with Twilio Title: How to send SMS at scale with Twilio

    If you want to send a single SMS using Twilio you'll need a Twilio account, a phone number to send them from, and of course you'll need to know the destination phone number and the content of the message. Once you have these you can send your message with a single API call either with a direct HTTP request, or using any of our helper libraries. Check out our Programmable SMS Quickstarts for more details.

    What if you need to send a hundred messages? Or a thousand? Or even more? In this post I'll talk through the challenges you may face as you scale up and how to get past them. Code samples will be in Java but the same principles apply with any programming language.

    Sending a single SMS

    Sending one SMS with Java is covered in this blog post. Feel free to go and read it, …

    Read More
  • By Robert Alford
    Build a Contact Form for a Python Django Application with Twilio SendGrid Build a Contact Form for a Python Django Application with Twilio SendGrid

    A contact form is a common feature of many websites that provides a way for users to get in touch with the site’s administrators without having to open their email or hop on the phone. In a Python Django application, a contact form can be used to store a user’s contact information in the site’s database. And with Twilio SendGrid, we can also trigger an automated email containing that information as soon as the form is successfully submitted.

    In this tutorial, we will build a simple contact form for a Django web application that does just that.

    Project screenshot

    Tutorial requirements

    • Python version 3.6 or higher. If you do not have Python installed on your computer, you can download a free installer here.
    • A free Twilio SendGrid account. Sign up here to send up to 100 emails per day completely free of charge.
    • The Django web framework. Django is a fully …
    Read More
  • By Ashley Boucher
    Transcribe a Voice Message in Node.js with Twilio Functions voicetranscribe.png

    In this tutorial you’ll leverage Twilio Programmable Voice to receive phone calls at your Twilio phone number, and transcribe any voice messages left by the caller. This guide can be used as a foundation to build your own voicemail system.

    Prerequisites

    To get started with this tutorial, you’ll need the following:

    Create a new Twilio Functions Service

    Through Twilio, you can configure a webhook that will handle any incoming calls to your Twilio phone number.

    You’ll need a place to host the code for the webhook - this could be your own server, or locally running application, but for this tutorial you’ll use Twilio Functions. Twilio Functions is a serverless environment that lets you deploy backend services without the overhead of setting …

    Read More
  • By Sylvan Ash
    Envoyer des rappels SMS en PHP depuis votre app Symfony rappels-sms-php-symphony-banner

    Si vous avez un système de réservations, et que vous prenez des rendez-vous de type massages, psychologues, dentaires ou médicaux, etc… ça serait sûrement pratique de rappeler aux clients la date de ce rendez-vous après qu’ils l’aient réservé, ou même à la personne qui leur offre le service.

    Dans ce tutoriel, vous apprendrez à envoyer des rappels SMS aux clients à un temps donné avant leur rendez-vous dans un projet Symfony qui utilise le service SMS de Twilio.

    Cet article part du principe que :

    • Vous avez déjà paramétré LAMP, MAMP, XAMPP, ou un environnement de développement équivalent.
    • Vous êtes familiers avec Symfony 

    Mise en place

    On utilisera composer (un outil pour la gestion des dépendances) afin d’installer Symfony et le  SDK Twilio. Les instructions d’installation de composer peuvent être trouvées ici. Aussi, soyez sûrs d’installer composer globalement en suivant les instructions dans la sous-partie globale …

    Read More
  • By Dominik Kundel
    ガイド: Node.jsでログを記録する方法 A guide to Node.js logging

    この記事はTwilio Developer AdvocateのDominik Kundelこちらで執筆した記事の日本語版です。

    JavaScriptで開発を始める際に最初に学ぶことの1つは、console.logを使用してイベントなどをコンソールにロギングする方法でしょう。JavaScriptのデバッグ方法を検索すると、console.logのシンプルな利用方法に関するブログや、StackOverflowの記事が数百件ヒットします。console.logは一般的な手法ですが、不要なログステートメントを本番コードに残さないためにno-consoleなどのlinterルールも登場しています。しかし、特定の情報を意図的にロギングする場合は、どうすれば良いのでしょうか?

    この記事では、情報をロギングするさまざまなケースを紹介します。さらに、Node.jsにおけるconsole.logconsole.errorの違いや、ユーザーコンソールを混乱させずにロギングをライブラリに組み込む方法についても解説します。

    console.log(`Let's go!`);
    

    第1の理論: Node.js

    console.logまたはconsole.errorはブラウザやNode.jsで使用できますが、Node.jsで使用する際に注意すべき重要な点があります。例えば、Node.js環境でindex.jsというファイルに、次のコードを記述します。

    console.log('Hello there');
    console.error('Bye bye …
    Read More
  • Newer
    Older
    Sign up and start building
    Not ready yet? Talk to an expert.