Now that we have set up our development environment, we can start building our chatbot.įor this tutorial the chatbot will be very simple.
If you are using a Unix or Mac OS system, open a terminal and enter the following commands to do the tasks described above:
We will then install the packages we require inside of it. We will create a separate directory for this project and create a virtual environment using Python’s inbuilt venv module. We are now going to start developing our chatbot application. You can also connect additional phone numbers to this sandbox by repeating the same process. After a moment, you should receive a reply from Twilio confirming your mobile number is connected and can start sending and receiving messages.
To enable the WhatsApp sandbox for your smartphone, send a WhatsApp message with this code to the number assigned to your account. You will also see a code that starts with join followed by two random words.
You should now see the sandbox phone number assigned to your account as below. From there, select Programmable SMS and then click on WhatsApp on the left-hand menu. From your Twilio Console, open the Dock by clicking on the three dots on the left-hand side of the page.
Let’s start by connecting your smartphone to the sandbox. Once you are happy with your application and want to put it into production, you can request access for your Twilio phone number, which requires approval by WhatsApp. Twilio provides a WhatsApp sandbox allowing you to easily develop and test your application. When you sign up, ensure you use the same phone number as the one you will use to test this application.
You can review the features and limitations of a free Twilio account. If you are a new user, you can create a free account. A smartphone with an active phone number and WhatsApp installed.Installation instructions for your operating system can be found here. We will use this free utility to connect our Flask application running on our local system to a public URL that Twilio can connect to from the Internet. We will use this web framework to build an application that responds to incoming WhatsApp messages. To follow this tutorial you will need the following: The chatbot will allow users to get information about soccer teams and match statistics.