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 Marcus Battle
    Create Your Own Phone Backup Service using PHP, WhatsApp API, DigitalOcean Spaces, and Laravel Create a Phone Backup Service using WhatsApp.png

    Have you ever had a video from a loved one that you wanted to keep forever? Maybe a picture that you wanted to save but didn’t want to add to your phone? Whatever the use case, it’s almost impossible to backup some types of media, like voicemail and contacts, without an app.

    We're going to learn how to create a phone backup service that allows us to manually transfer data via WhatsApp to cloud storage, just by using our phone number.

    We will accomplish this by creating a RESTful API in Laravel, connecting it to Twilio’s WhatsApp API, and adding cloud storage via DigitalOcean Spaces.

    In order to complete this tutorial you will need the following:

    At the time of writing, DigitalOcean does not provide an official PHP API for connecting to its object storage. …

    Read More
  • By Charles Oduk
    Implementing the Open-Closed Principle in Laravel PHP with Twilio SMS Implementing the Open-Closed Principle in Laravel with Twilio SMS .png

    Introduction

    The SOLID design principles by Robert C. Martin, popularly known as Uncle Bob, are a set of principles that help a developer write clean, reusable, and maintainable code. The five principles that make up the acronym SOLID are:

    1. S - Single Responsibility Principle
    2. O - Open/Closed Principle
    3. L - Liskov Substitution Principle
    4. I - Interface Segregation Principle
    5. D - Dependency Inversion Principle

    In this tutorial, we are going to look at the Open/Closed Principle. It states that entities should be open for extension but closed for modification. Essentially, it should be simple to change the behavior of a particular entity without modifying the original source code. New developers may find this principle confusing at first. It is the goal of this tutorial to help developers understand Object Oriented Programming by demonstrating the use of the Twilio SDK for PHP in a Laravel application.

    NOTE: We are …

    Read More
  • By Joe Previte
    How to Release a Custom React Component, Hook or Effect as an npm Package ORXOra5m--S2QumnCfLwH_eCmlbMkYQ2BuIeSDbYT0KizCG2idnIgP6xz_EeIcmdwtq446pHDY5f3iNASDN16OD8cscswfAy4ARnnH3ScJxEfg9c3AVoACtMHV2fEW3c7UjABzsr

    At my previous company, I was chatting with a coworker about getting more into open source. I told him I wanted to release an open source npm package. He suggested I try it with a custom React hook/effect I had written the month prior. It had the purpose of closing a dropdown menu or container when you clicked outside of it.

    Together, we ambitiously tackled the goal and released a package called react-use-click-away 🎉 It isn’t a perfect package but it gave us that experience we were longing for.

    While figuring out how to do all this, I realized it felt more intimidating than it should have. To solve that, I’m going to show you all the things you need to know in order to release your own custom React component, hook or effect as an npm package 😎 Let’s do it!

    Things You Should Know

    Before we jump in, …

    Read More
  • By Felistas Ngumi
    Add Querying and Pagination to a CRUD RESTful API in PHP with API Platform and Symfony 4 Add Querying and Pagination to a CRUD RESTful API in PHP with API Platform and Symfony 4.png

    Now that we have created a simple CRUD API, let's learn how to retrieve the data we want using query parameters, customize the pagination of the results, then create custom controllers and endpoints.

    NOTE: This tutorial is Part 2 of a 2-part series. If you haven't completed Part 1, it is available here.

    Adding Custom Operations to Your Endpoints

    API platform automatically creates CRUD operations when the resource is created. Custom operations can be assigned to specific routes if an operation is specified. There are two types of operations for collections and items. Collection operations are operations that act on a group of resources such as retrieving all bucket lists. Item operations are operations that act on a single resource such as retrieving one bucket list. For collection operations, the GET and POST routes are implemented with the GET operation being enabled by default. In item operations, the …

    Read More
  • By Phil Nash
    Text to speech in the browser with the Web Speech API speech-synth-header.png

    The Web Speech API has two functions, speech synthesis, otherwise known as text to speech, and speech recognition. With the SpeechSynthesis API we can command the browser to read out any text in a number of different voices.

    From a vocal alerts in an application to bringing an Autopilot powered chatbot to life on your website, the Web Speech API has a lot of potential for web interfaces. Follow on to find out how to get your web application speaking back to you.

    What you'll need

    If you want to build this application as we learn about the SpeechSynthesis API then you'll need a couple of things:

    Once you're ready, create a directory to work in and download this HTML file and this CSS file to it. Make …

    Read More
  • By Marcus Battle
    Top PHP State Management Tutorials of August 2019 Top PHP State Management Tutorials of August 2019.png

    Do you want a cookie?

    Almost everyone in the world likes cookies. It’s hard not to like cookies when grandmas, commercials, and bright-eyed Girl Scouts make them impossible to avoid. Those addictive, sweet, circles of joy are so ingrained into our everyday lives that even our dogs and kids don’t stand a chance at avoiding these fine treats.

    It would only make sense that something so delicious would eventually permeate non-food categories. In the mid-1990s, cookies continued their conquest and found their way into technology. 

    During early web browser development, a founding engineer of Netscape Communications decided that the protocol that best-implemented state management should be called “cookies”. Lou Montulli believed that fortune cookies best defined these bits of information delivered in small packets.

    For the past 25 years, cookies have taken the lead in managing state within web applications. However, microservices such as Twilio Sync offer an additional option …

    Read More
  • By Paul Kamp
    The Developer's Guide to Phone Number Regulatory Compliance qMvMl-7km51ZMwhLfA9kzW7AuNTyFppuGJKF6KKCyEO9dww1zxhJx63sQtynlA-KcCmabxeF6CUXASv_llpD4QXQbcOQGAJ7XqhI_yzpb7HXAtbHgIXN1yGLCUkh7GdYQ7qocnay

    Regulatory compliance (RC) requirements for phone number users have increased worldwide. Depending on the phone number and its features, your or your company's status in the country, and your intentions for the number, different laws and regulations apply while building Voice, Fax, or SMS-based applications.

    While some of these regulations are new, many of these laws and rules have been in effect for some time. Countries are increasing enforcement for many reasons – including fraud, incidents of misuse and abuse and heightened national security concerns.

    All your Twilio phone numbers on Twilio’s platform need to comply with individual country requirements or they are at risk of being suspended until you submit proper RC information.

    Read on for what you need to know to bring an existing communications application into compliance or before starting a new application.

    Here's a video overview explaining what's happening:

    You can find the regulatory …

    Read More
  • By Lizzie Siegle
    Top 5 Things to Consider for Building Better Bots top 5 things to consider for building better bots

    There's a lot of conflicting information on best practices when building bots, so we set out to make your chatbot-building life easier in our new comprehensive guide to Intelligent Chatbots.

    That massive resource provides developers, builders, and DOers with an intelligent bot guide, covering bot use cases, descriptions of how bots work, instructions on building and deploying bots, intelligent bot best practices, and more.

    In this post, I’ll summarize some of that guide and tell you what you need to consider to build better bots.

    1. Pick your use case and type of chatbots

    Baymax GIF saying an impersonal greeting

    The purpose of most bots is often to automate tasks, save time, or just to generally make life easier – just like with most other tools and automation. So first, you’ll need to consider your bot’s use case.

    Various industries use chatbots in different ways. Here’s a list …

    Read More
  • By Dustin Ewers
    Building A Cloud Native ASP.NET Core Application and Deploying it to Azure Kubernetes Service with Docker 7EUCzPY9JgIdXMFYmG1BWkow-WFFrnyLHtoiBRhdFWRzMC4rqJ1afaZqAR6VyBd8pB9s_XzO9AmmcJMjDeW8j7Zimys2HbbxY5qh5q27hBHVd3o2zJbHw450LnCGAZp3u2gMMVus

    As developers, we mostly focus on building applications. However, building the app is only half the story. To consider things “done,” we need to get that app deployed into the wild where people can use it. In the .NET world, there’s no shortage of ways we can host our apps, but today, I’d like to focus on building cloud native .NET applications.

    In this post, you’ll learn about building cloud native applications in ASP.NET Core. You’ll learn how to design for the cloud, spin up an Azure Kubernetes Service instance, and deploy your application into the cloud. By the end of this post, you’ll have the tools to build and deploy your own cloud native ASP.NET applications.

    What do you mean by “cloud native”?

    “Cloud native” is one of those terms that sounds obvious, but there’s a more specific definition.

    The Cloud Native Computing Foundation defines the term as follows: …

    Read More
  • By Michael Jaroya
    Send Inspirational Quotes Every Morning in PHP Using Cron, SendGrid, Twilio SMS and Quote APIs Create A Daily Inspirational App in PHP.png

    Ever had one of those mornings when you woke up unmotivated, but read a quote and the energy returned? That is the power of positive and motivational quotes.

    Motivational quotes have a way of making people feel inspired and energized. This phenomenon can be attributed to a combination of factors such as motivational psychology, wordsmithing, and self-selection.

    In this tutorial, I am going to teach you how to create an app that automatically sends you motivational quotes every morning. Before we start, here is a motivational quote to uplift you as you follow along.

    Believe in yourself! Have faith in your abilities! Without humble but reasonable confidence in your own powers, you cannot be successful or happy. – Norman Vincent Peale

    Getting Started

    To complete this tutorial, you will need the following:

    Create a New …

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