Build the future of communications.
Start building for free

Code, Tutorials and Hacks

  • By Alex Baban
    Engineering for Peace of Mind with Twilio SMS and the AWS IoT Button ZZCMxWWjLt9FSj1SRMS8EOcZP3L5fg4ImlLt0gVBT2yM3w_DCHlhE6txIwVVzLYvy89rJEZ6G-544NdetnIXR-Y4qchnKaCRUqG_Xx8dODQ7SUImHMYgumaLpn8fwVKz-Oh7CJSB

    My octogenarian dad still lives independently.

    He does not enjoy his son calling him every night and interrupting his movie-watching. Some nights he's not even at home yet because he's chilling at the pub across the street. He also forgets to charge his cell phone on a regular basis.

    These are all the things running through my mind when I want to check in with him and know everything is fine.

    What are we going to build

    As a software developer, I want my dad to have a button handy where he can "SINGLE click" to tell me "I'm fine, good night" with a text message. After a  "DOUBLE click" I want to receive a text message like "Call me when you have time." When dad gives the button a "LONG click" I want to receive a text message and a voice call with "I need your help now ...

    Read More
  • By Marcus Battle
    Top 7 PHP Tutorials with Twilio for July 2019 Top 7 PHP Tutorials with Twilio for July 2019.png

    From building chatbots to RESTful APIs from scratch, this month’s roundup includes several engaging tutorials. We’ve compiled our top seven PHP tutorials to help you build the future of communications this summer while you’re coding in the air conditioner or at your favorite resort.

    Can you keep a secret?

    Game of Thrones has ended and Avengers has already cycled through the box office, but with the fall season premieres quickly approaching, a new opportunity to spoil your friends' favorite shows is just around the corner. In this intriguing tutorial by Dotun Jolaso, you will learn how to build a spoiler app in PHP with Twilio SMS and Laravel. Your Laravel app will employ bulk SMS messaging via Twilio Copilot to tease subscribers with spoilers after the show airs.

    Everyone needs a little REST

    APIs are not only the backbone of Twilio, but they are also arguably the ...

    Read More
  • By Tilde Thurium
    Detect Robocalls with Twilio Lookup, Node.js and the Nomorobo Spam Score Add-on Detect Robocalls with Twilio Lookup, Node.js and the Nomorobo Spam Score Add-on

    Robocalls: nobody likes them, except maybe the robots. Twilio is working hard to eliminate robocalls. For the moment we need additional ways of fighting back. Let’s build a tool with Node.js, Nomorobo, and Twilio Lookup to detect robocalls. It’s easier than a Voight-Kampff test, I promise.

    Getting Started

    What you’ll need:

    Nomorobo is a company that maintains a huge database of known spammers and bots, as well as providing a service for filtering out unwanted calls. To take advantage of these features, install the Nomorobo add-on from the Twilio Console. 

    Click the install button and agree to the terms of service.  Keep the unique name as nomorobo_spamscore. Under USE IN, check the Lookups box and click Save.

    Making The Initial Lookup

    Install the Twilio Node helper library ...

    Read More
  • By Nathaniel Okenwa
    Create a Smart Voicemail with Twilio, JavaScript and Google Calendar 6RDc-eMExBn8vtkgQRwJxsbID95IbJXkGqac1ZoC8vMmh40ejzYE0H0RD1yoyU64-7sQHZwNABCgxkmymMgmiXigQvcqs5B4nelE6RkAneOPJ-DfU30ClMG24vUDqrHnZZH3jKQ1

    We’ve all been there, in an important meeting, you’ve forgotten to mute your phone and all eyes turn to you as you frantically search through your pockets to silence it. That feeling of embarrassment is only matched by the frustration of listening to your voicemail. I dread hearing the robotic voice telling me what numbers to press only to be presented with the sound of somebody hanging up the call.

    To take the hassle out of handling missed calls, today we are going to look at how to create a virtual office manager that is aware of your busy schedule, to handle calls and voice messages for you.

    What We Need

    • A Twilio Account (Get one here for Free)
    • A Twilio Phone Number
    • A Google Calendar
    • Google Calendar API Key

    Before We Begin

    To start off, we need to create a Google Project and enable the Google Calendar ...

    Read More
  • By Maciej Treder
    Asynchronous JavaScript: Understanding Callbacks Asynchronous JavaScript: Understanding Callbacks

    By design, JavaScript is a synchronous scripting language. In fact, many of the widely used asynchronous functions in JavaScript are not part of the core language. Understanding how asynchronous features work in the JavaScript ecosystem, including the role played by external APIs, is an essential part of using the language effectively.

    This post will show you how to use asynchronous functionality in JavaScript. It’s also going to explain an important difference between the way code execution works in JavaScript and other languages and frameworks. Understanding this difference is essential to understanding how to do asynchronous programming with JavaScript.

    Understanding JavaScript asynchronous code

    JavaScript programs rely on a JavaScript runtime environment for execution. Browsers, like Chrome and Firefox, and application servers, like Node.js, include a runtime environment as part of the application. This enables websites to run JavaScript in client browsers and standalone JavaScript applications to run in Node ...

    Read More
  • By Maciej Treder
    Asynchronous JavaScript: Organizing Callbacks for Readability and Reusability cxgwWEzJkPC0ZPM2fWcHu3BrGZXaMUO2Z0tUwOu9UTctbND9UrJpqwisJe7EOp9UZlf6sUZhhnH80lvOQadVfLyAfaswgFqm0BB9rs6FD9beeFkQYLMHSwNBo1kNwgkMMrBcHX4l

    Asynchronous programming is an essential part of being a complete JavaScript programmer. Understanding the code execution flow in JavaScript is the foundation of understanding how it can handle asynchronous tasks. And being able to program asynchronous tasks enables you to take advantage of the extensive array of functions provided by JavaScript runtime engines and external APIs. With those tools you can connect your JavaScript programs with web APIs across the internet and effectively manage those—sometimes tenuous—connections.

    With power comes complexity. Using JavaScript callbacks to implement asynchronous functionality can quickly create a series of deeply nested function calls. This post will show you how to write and organize your JavaScript callbacks to maximize the readability, maintainability, and reusability of your asynchronous functions.

    As an old programming saying goes:

    Any fool can write code that a computer can understand. Good programmers write code that humans can understand.

    The first part ...

    Read More
  • By Ryan Kauffman
    How to Make a Smart Baby Monitor with Python, Raspberry Pi, Twilio SMS, and Peripheral Sensors How to Make A Smart Baby Monitor with Python

    Have you ever wanted a smart monitor that not only lets you see your kids, but also texts you the temperature in their crib, so you can be certain they are comfortable? I certainly have!

    That’s why I made the Raspberry Pi (RPi) Smart Baby Monitor, and I want to show you how easy it is to build yourself using Twilio, a Raspberry Pi, and a little bit of code.

    Here's my son at 4 months old along with the smart baby monitor I created for him:

    Smart baby monitor

    The Tech Stack

    The IoT app we are going to create will use the Python programming language, a Raspberry Pi, a Raspberry Pi camera, a DS18B20 temperature sensor, and the Twilio SMS API:

    - Python version 3.5: The language we will write our code in

    - Raspberry Pi: Environment that will hold our software (code) and our hardware (peripherals)

    - RPi Camera: the camera ...

    Read More
  • By Dotun Jolaso
    Build a Spoiler App in PHP with Twilio SMS and Laravel TV Show Spoiler App with Twilio SMS & Laravel.png

    In this tutorial, we’ll be building an SMS application that sends out spoiler alerts to our friends every week after the show has been aired. We’ll be making use of Twilio’s Copilot feature to learn how we can send outbound SMS to a large number of people at once.

    Technical Requirements

    To follow along, you’ll need the following:

    Create New Laravel Project

    Let’s install a new Laravel project via the Composer create-project command. From your terminal, run the following command:

    $ composer create-project --prefer-dist laravel/laravel twilio-got-spoiler

    This will install a new Laravel project for us in the twilio-got-spoiler directory.

    Creating Models and Migrations

    We’ll be needing two migrations. One for storing the spoilers to be sent out and the other for storing the phone numbers that should receive those spoilers.

    From ...

    Read More
  • By Yashvier Kosaraju
    Preventing Attacks Using HTTP Headers Copy of Generic Blog Header 1.png

    Modern browsers have built-in security features that respond to specific headers in HTTP responses.

    While these headers are relatively easy to enable and use, they provide significant security by instructing browsers to adhere to certain security rules. In this post, we’ll detail ways to use security headers to protect yourself and your users.

    Use headers to improve security

    Over the years, browsers have implemented headers suited for various tasks including defense against attacks. Here are some of the headers you can set from your application to help protect sensitive data and keep your websites secure..

    Prevent access to sensitive information with headers

    You can use security headers to prevent attackers from gaining access to sensitive or confidential information. One powerful attack, SSL stripping, was first presented by Moxie Marlinspike at Black Hat 2009.

    SSL Stripping is a type of man-in-the-middle attack in which HTTPS requests are stripped back down ...

    Read More
  • By Michael Okoh
    Building and Consuming a RESTful API in Laravel PHP Building and Consuming a RESTful API in Laravel.png

    From your favorite social networks, down to your favorite banking applications, our modern world is driven by a lot of APIs. In this article, you will learn how to build a modern RESTful API and an application that will implement the API.


    • PHP 7.1 or Higher
    • Composer
    • MySql
    • Laravel 5.6 or Higher
    • Postman

    To follow along with this tutorial, you should have a basic understanding of the PHP language. Basic knowledge of the Laravel framework is required.

    Understanding our Application

    You will be building a CRUD API. CRUD means Create, Read, Update, and Delete. Our API will have the following endpoints:

    GET /api/students will return all students and will be accepting GET requests.

    GET /api/students/{id} will return a student record by referencing its id and will be accepting GET requests.

    POST /api/students will create a new student record and will be accepting POST ...

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