Download the PHP package michotechnologies/michowapi-laravel without Composer
On this page you can find all versions of the php package michotechnologies/michowapi-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download michotechnologies/michowapi-laravel
More information about michotechnologies/michowapi-laravel
Files in michotechnologies/michowapi-laravel
Package michowapi-laravel
Short Description Laravel SDK for MichoWAPI - WhatsApp messaging gateway by Micho Technologies
License MIT
Informations about the package michowapi-laravel
MichoWAPI Laravel SDK
Official Laravel SDK for MichoWAPI — the WhatsApp messaging gateway by Micho Technologies.
Send text messages, upload media files, retrieve message history, and handle webhooks — all from your Laravel application using a clean, fluent API.
Requirements
- PHP 8.1+
- Laravel 10, 11, or 12
Installation
Laravel auto-discovers the service provider and WApi facade automatically. No manual registration needed.
Publish the config file:
Configuration
Add the following to your .env file:
| Variable | Description | Default |
|---|---|---|
MICHOWAPI_URL |
Base URL of the MichoWAPI gateway | https://wapi.michotech.me |
MICHOWAPI_KEY |
Your API key (format: mw_ + 40 chars) |
— |
MICHOWAPI_TIMEOUT |
HTTP timeout in seconds for text requests | 30 |
MICHOWAPI_MEDIA_TIMEOUT |
Timeout for media file uploads | 120 |
MICHOWAPI_WEBHOOK_SECRET |
HMAC secret for verifying webhook payloads | — |
Note: Each API key is bound to one WhatsApp session automatically — you do not pass a session ID in requests. To use multiple WhatsApp numbers, generate a separate key per session and instantiate the client separately for each.
Getting Started
1. Create a Session
Log into the MichoWAPI dashboard, go to Sessions, click New Session, and scan the QR code with your phone via WhatsApp > Linked Devices.
2. Generate an API Key
Go to API Keys, click Generate API Key, select the session, and copy the key. It will not be shown again.
3. Send Your First Message
Usage
Via Facade
Via Dependency Injection
Messages
Send Text
Phone numbers must include the country code and contain digits only (e.g. 260971000000, not +260 971 000 000).
Send Media
Send any file (image, video, audio, PDF, etc.) using sendMedia(). The file is uploaded directly — no public URL required.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
$to |
string | Yes | Recipient phone number |
$file |
string / SplFileInfo / resource | Yes | File path, SplFileInfo, or stream |
$filename |
string|null | No | Override the filename shown to recipient |
$caption |
string|null | No | Caption shown below the media |
$sendAsDocument |
bool | No | Force the file to be sent as a document |
Send as Document
Use sendDocument() as a shortcut to always send as a document attachment:
Send Bulk
Send the same text to multiple recipients. Returns results keyed by phone number.
Message History
List Messages
Get a Single Message
Received Messages
Sync Messages
Pull in messages that arrived while the session was offline:
Messages in a Specific Chat
Webhooks
Configure
Set your webhook URL in the MichoWAPI dashboard under your session settings.
Register a route:
Exclude from CSRF in bootstrap/app.php (Laravel 11+):
Handle Webhook Events
Webhook Event Types
| Event | Description |
|---|---|
message.received |
Incoming message from a contact |
message.sent |
Outgoing message confirmed sent by WhatsApp |
session.connected |
Session successfully authenticated |
session.disconnected |
Session lost connection |
Webhook Payload Shape
Failed deliveries are retried up to 3 times with exponential backoff (1 min, 5 min, 15 min).
Error Handling
The SDK throws specific, typed exceptions for every error scenario:
Exception Reference
| Exception | HTTP Status | Error Code(s) | Description |
|---|---|---|---|
SessionNotConnectedException |
422 | SESSION_NOT_CONNECTED |
Session not active |
RateLimitException |
429 | RATE_LIMITED |
Too many requests |
AuthenticationException |
401, 403 | UNAUTHORIZED, INVALID_API_KEY, NO_SESSION |
Auth failure |
ValidationException |
422 | VALIDATION_ERROR |
Invalid request params |
MichoWapiException |
any | any | Base class for all SDK errors |
Rate Limits
| Plan | Limit |
|---|---|
| Free | 60 requests/minute |
| Pro | 300 requests/minute |
| Enterprise | Custom |
Real-World Examples
MichoSMS: Notify Parents of Exam Results
Send an Invoice PDF
Auto-Reply to Incoming Messages
License
MIT. See LICENSE for details.
About Micho Technologies
MichoWAPI is built and maintained by Micho Technologies, a software company based in Zambia building modern technology for the African market. Other products include MichoSMS (school management) and MyTutor ZM (peer-tutoring marketplace).
All versions of michowapi-laravel with dependencies
guzzlehttp/guzzle Version ^7.0
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/contracts Version ^10.0|^11.0|^12.0|^13.0
illuminate/http Version ^10.0|^11.0|^12.0|^13.0