https://github.com/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.
https://github.com/guduchango/meta-api
automation chatbot-backend laravel message-processing php rest-api webhooks whatapp-bot
Last synced: 6 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/guduchango/meta-api
- Owner: guduchango
- Created: 2025-07-12T15:24:28.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-07-12T15:46:29.000Z (8 months ago)
- Last Synced: 2025-07-12T17:52:10.064Z (8 months ago)
- Topics: automation, chatbot-backend, laravel, message-processing, php, rest-api, webhooks, whatapp-bot
- Language: PHP
- Homepage: https://edgardoponce.com
- Size: 23.2 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ๐ฌ 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
1. WhatsApp Business sends a webhook POST request to the Laravel API.
2. The API receives and validates the message, then stores it in the database.
3. A separate daemon polls or listens for new messages.
4. The daemon processes the message (e.g., using AI, rules, etc.).
5. 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:
```json
{
"phone": "+5491112345678",
"message": "Hello, I need help with my order."
}
```
## ๐งช Testing
You can test the API locally using tools like **Postman** or **cURL**:
```bash
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