Skip to content

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.

Notifications You must be signed in to change notification settings

guduchango/meta-api

Repository files navigation

📬 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:

{
  "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

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy