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.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package michowapi-laravel

MichoWAPI Laravel SDK

Latest Version on Packagist

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


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

PHP Build Version
Package Version
Requires php Version ^8.1
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
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package michotechnologies/michowapi-laravel contains the following files

Loading the files please wait ...