GU
guduchango/meta-api
Laravel 10 API that receives messages from WhatsApp Business, stores them in a local database, and allows a background process to read, process, and respond. Built for AI-based or rule-based message automation workflows.
๐ฌ WhatsApp Business API Bridge - Laravel 10
This project is a lightweight Laravel 10 API designed to act as a bridge between WhatsApp Business and a local message processing system. It receives incoming messages from WhatsApp, stores them in a local database, and allows a background daemon process to pick them up, process them with AI or business logic, and send appropriate responses.
โ๏ธ Features
- ๐ฉ Receives and stores incoming messages from WhatsApp Business.
- ๐๏ธ Persists data in a local MySQL database.
- ๐ง Designed for integration with background processing (e.g., AI via Ollama, custom message handlers).
- ๐ Secure API endpoints with basic validation.
- ๐งฑ Built using Laravel 10 (PHP 8.2+).
๐งฉ Tech Stack
- Backend: Laravel 10 (REST API)
- Database: MySQL
- Messaging: WhatsApp Business API
- Message Handling: External background daemon (e.g., Python script, AI inference)
๐ ๏ธ How It Works
- WhatsApp Business sends a webhook POST request to the Laravel API.
- The API receives and validates the message, then stores it in the database.
- A separate daemon polls or listens for new messages.
- The daemon processes the message (e.g., using AI, rules, etc.).
- The response is sent back to WhatsApp using the appropriate Business API endpoint.
๐ API Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/messages |
Receives WhatsApp messages |
Example payload:
{
"phone": "+5491112345678",
"message": "Hello, I need help with my order."
}๐งช Testing
You can test the API locally using tools like Postman or cURL:
curl -X POST https://yourdomain.com/api/messages \
-H "Content-Type: application/json" \
-d '{"phone":"+5491112345678", "message":"Test message"}'๐ Future Improvements
- Add authentication via API tokens.
- Add message reply endpoint.
- Implement message queuing (e.g., Laravel queues or Redis).
- Web UI for message log review.
๐ค Contributing
Feel free to fork this repo and open a pull request. Feedback and improvements are welcome!
๐ License
MIT License
On this page
Languages
PHP75.9%Blade23.9%JavaScript0.2%
Created July 12, 2025
Updated November 10, 2025