Download the PHP package excelle-insights/whatsapp without Composer
On this page you can find all versions of the php package excelle-insights/whatsapp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download excelle-insights/whatsapp
More information about excelle-insights/whatsapp
Files in excelle-insights/whatsapp
Package whatsapp
Short Description WhatsApp Cloud API integration package — OAuth, template messaging, business profiles, webhooks, and HTTP request logging
License MIT
Homepage https://github.com/excelle-insights/whatsapp
Informations about the package whatsapp
Excelle Insights WhatsApp Cloud API
A PHP package for integrating with the Meta WhatsApp Cloud API. Handles OAuth authentication, WABA discovery, message templates, inbound/outbound messaging, webhooks, and HTTP request logging.
Features
- OAuth 2.0 — Meta Login for Business with long-lived token exchange and auto-refresh
- WABA Discovery — Auto-detect all WhatsApp Business Accounts the user can access
- Business Profiles — Link WABAs, fetch/update business profile data, sync phone numbers
- Template Management — Create, list, delete message templates; track approval via webhooks
- Message Sending — Text, template, and media messages
- Webhook Processing — Verify webhooks, receive inbound messages, handle status callbacks
- Inbound Media — Auto-download and store images, videos, audio, documents, stickers
- HTTP Request Logging — Every API call logged to
http_request_logstable - PDO-based — Uses MySQL via PDO (extensible to other databases)
- Configurable Table Prefix — All WhatsApp tables use the
WHATSAPP_TABLE_PREFIXenv var
Installation
Environment Setup
Create a .env file in your project root:
Quick Start
1. OAuth Authentication
Generate the Meta authorization URL:
Handle the callback (your WHATSAPP_REDIRECT_URI endpoint):
Or use a direct System User token (skip OAuth):
2. Send a Text Message
3. Send a Template Message
4. List Templates
5. Webhook Setup
Incoming media messages (image, video, audio, document, sticker) are automatically downloaded to WHATSAPP_MEDIA_PATH (default uploads/whatsapp) and stored on the message record with media_type, media_url, media_mime_type, media_file_size, caption and wa_media_id.
6. Download Media Manually
Files are stored at {WHATSAPP_MEDIA_PATH}/{YYYY}/{MM}/{DD}/{sha1}.{ext}. Serve them through an authenticated proxy (see examples/media-proxy.php); block direct web access to the storage folder.
Database Migrations
Run the provided Phinx migrations to create the required tables:
Tables created (all prefixed by WHATSAPP_TABLE_PREFIX):
| Table | Purpose |
|---|---|
{prefix}_business_profiles |
Linked Meta Business/WABA accounts |
{prefix}_access_tokens |
Per-user OAuth tokens |
{prefix}_templates |
Message templates |
{prefix}_template_components |
Template body/header/footer/buttons |
{prefix}_messages |
Inbound and outbound messages |
{prefix}_message_media |
Media attachments |
{prefix}_webhook_logs |
Raw webhook audit logs |
http_request_logs |
API request/response logs (non-prefixed) |
Advanced Usage
Custom HTTP Client
Inject a custom HTTP client for testing or custom logging:
Custom PDO Connection
Pass an existing PDO instance:
HTTP Request Logging
All API calls are automatically logged to the http_request_logs table with:
- HTTP method, URL, request/response headers and bodies
- Response status code and duration
- Sensitive headers (Authorization, X-API-Key) are redacted
Testing
License
MIT — see LICENSE.