Company
Date Published
Author
Dotun Jolaoso
Word count
1260
Language
English
Hacker News points
None

Summary

You can forward incoming SMS messages to WhatsApp using Twilio with Python. This is achieved by creating a Flask application that listens for HTTP POST requests from Twilio, extracts the message content and phone number of the incoming message, and then uses the Twilio API to send the message to WhatsApp. The application is made accessible over the internet using Ngrok, allowing Twilio's HTTP POST request to reach it. A Messaging service is created in Twilio to invoke a webhook request whenever an SMS message is received, and the Webhook URL is added to the messaging service. The Twilio WhatsApp sandbox is used for testing purposes before sending messages in production.