WhatsApp Webhook Service (Origimed/wpp)
2025 · Python, WhatsApp Cloud API, Webhooks
Context
The project aims to provide a lightweight Python service to receive and process WhatsApp Cloud API webhook events. It includes simple modules for message handling, reminders, and local logging — serving as a foundation for more advanced bots or customer-support automation.
Architecture
The service listens for incoming requests from the WhatsApp Cloud API. It handles
verification during webhook setup, logs every event locally, and routes messages to
helper functions. The reminder.py
module can be scheduled to send proactive
messages (for example, follow-ups or daily notifications).
- WhatsApp Cloud API → Python Webhook (
app.py
). - Modules handle message routing, responses, and logging.
- Environment variables store API tokens and verify tokens.
- Reminders triggered via cron or scheduled tasks.
Implementation
- Developed a Python Flask/FastAPI-style webhook endpoint.
- Handled WhatsApp
GET
verification andPOST
event delivery. - Created
modules.py
for helper utilities and message parsing. - Added
reminder.py
for automated outbound messages. - Logged all webhook payloads to
webhook_logs.log
for debugging.
Results & Learnings
Built a functioning webhook system capable of receiving and replying to WhatsApp messages using only Python and basic HTTP handling. Learned how to structure webhook-based services, validate tokens, and securely handle API credentials.
- Understood WhatsApp’s webhook verification process.
- Gained experience in event-driven design and async message flows.
- Explored extending the service with queues and cloud deployment (AWS/Lambda).
Repository
Source code is available on GitHub: https://github.com/Origimed/wpp
