Skip to content

Latest commit

 

History

History
43 lines (27 loc) · 2.27 KB

README.md

File metadata and controls

43 lines (27 loc) · 2.27 KB

Innovate-Hackthon-LightDev

Build a WhatsApp Chatbot With Python, Flask and Twilio

A chatbot is a software application that is able to conduct a conversation with a human user. In this Project we build a chatbot for WhatsApp using the Twilio API for WhatsApp and the Flask framework for Python.

Requirements

Python
Flask
ngrok
Twilio account



Twilio provides a WhatsApp sandbox where you can easily develop and test your application. Connect your smartphone to the sandbox. Twilio Console -> Messaging -> Try it Out -> Send a WhatsApp message
The WhatsApp sandbox page will show you the sandbox number assigned to your account, and a join code.

To make local host server service reachable from the Internet we can use ngrok which allocate a temporary public URL that redirects HTTP requests to our local host server where, we can handle request and send back suitable Response to Whatsapp
Twilio Console -> Messaging -> Setting -> WhatsApp sandbox setting
and paste ngrok url in WHEN A MESSAGE COMES IN field

In our case we are handling POST request at http://localhost:5000/bot and our ngrok url is https://24df-2401-4900-36a4-a53b-1068-c2c9-b470-8e64.ngrok.io so our final url will be https://24df-2401-4900-36a4-a53b-1068-c2c9-b470-8e64.ngrok.io/bot

Testing the Chatbot

image

Developed by