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

Mezzio posts

  • By Matthew Setter
    Build a WhatsApp Chatbot with PHP, Mezzio, and Twilio Build a WhatsApp Chatbot with PHP, Mezzio, and Twilio

    A chatbot is a software application that a person can have a conversation with, either in written or spoken form. That said, their capacity to have a conversation often varies greatly. For example, some chatbots can only answer quite a limited set of specific questions (sometimes in a fixed order). Others, however, use a combination of artificial intelligence (AI) and machine learning (ML) to interact almost as a human could.

    In this tutorial, I'm going to show you how to build a small, simplistic chatbot using the Twilio API for WhatsApp, the Mezzio framework for PHP, and the Weather API to retrieve the current weather forecast for any city around the world.

    How will the chatbot work?

    Before we dive in and write code, let’s get a quick overview of how the chatbot will work. In essence, here’s the logic of the project:

    1. A user will send a …
    Read More
  • By Matthew Setter
    How to Reply to an SMS with PHP’s Mezzio Framework

    In my previous tutorial on how to send an SMS with PHP’s Mezzio framework, we covered sending a text message in PHP. In this tutorial, we’ll expand on the application that we built so that it can also reply to an SMS when it is received.


    To follow along with this tutorial you should have the following:

    To get started, clone version 1.0.0 of the repository that we created in the previous tutorial. Alternatively, follow the previous tutorial to create what we achieved.

    Note: If you cloned the repository, make sure that you add your Twilio Account SID, Auth Token, and phone number to the .env file in the root directory of the project. You will also need to run composer install to install existing dependencies for the project.

    Regardless of the approach that …

    Read More
  • By Matthew Setter
    How to Send an SMS with Mezzio PHP Framework How to Send an SMS with Mezzio PHP Framework

    Whether we’re voting for our favorite candidate on shows such as X Factor, or receiving two-factor authentication codes to log in to services like MailChimp and GitLab, SMS are virtually ubiquitous in modern life. Not only do they make communication in life and work much easier, it also doesn’t take a lot of code to send them either.

    In this tutorial, you’ll learn how to create a simplistic API that can send an SMS using PHP’s Mezzio framework and Twilio’s PHP SDK.

    Once completed, you will be able to send a POST request to the API’s default endpoint, supplying the phone number to send the message to, and the message to send. If the message was successfully sent, then a JSON response will be returned showing a number of details about the sent SMS. If the SMS was not able to be sent, then an appropriate JSON response will …

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