![]() ![]() The sandbox simplifies the process of developing and testing your application. A smartphone with an active phone number and WhatsApp installed.īefore you can start building the application, you first need to configure the Twilio WhatsApp Sandbox.If you don’t have ngrok installed, you can download a copy for Windows, and use macOS and Linux's package managers. This is necessary for the development version of the chatbot because your computer is likely behind a router or firewall, so it isn’t directly reachable on the Internet. We will use this handy utility to connect the PHP application running on your system to a public URL that Twilio can connect to. If you are new to Twilio click here to create a free account now and receive $10 credit when you upgrade to a paid account. To follow this tutorial you need the following components: There’s a bit more to how the chatbot will work, but we’ll cover that later, as we step through the code. I’ve tried to write it in a human-like way. ![]() Notice that it contains the city’s name, region/state, and country, along with the current temperature, what the temperature “feels like”, the humidity level, the wind speed, and the wind direction. The WhatsApp message that is sent back to the user will resemble the example below. Otherwise, it will let the user know that it couldn’t retrieve any weather data. If the weather information is available, the chatbot will then send a nicely formatted WhatsApp message, via Twilio, back to the user.Twilio will send this message to our chatbot, which will query the Weather API for the current weather report for that city.A user will send a WhatsApp message to a Twilio phone number, containing just a city name, such as Brisbane, Tokyo, or San Diego.In essence, here’s the logic of the project: How will the chatbot work?īefore we dive in and write code, let’s get a quick overview of how the chatbot will work. 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. Others, however, use a combination of artificial intelligence (AI) and machine learning (ML) to interact almost as a human could. For example, some chatbots can only answer quite a limited set of specific questions (sometimes in a fixed order). That said, their capacity to have a conversation often varies greatly. A chatbot is a software application that a person can have a conversation with, either in written or spoken form. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |