Download the PHP package gowa-php/sdk without Composer
On this page you can find all versions of the php package gowa-php/sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package sdk
Short Description Pure PHP SDK for the go-whatsapp-web-multidevice (GOWA) server
License MIT
Informations about the package sdk
🇧🇷 Para ler a documentação em Português, acesse README.pt.md.
⚡ Acknowledgments & Dependencies
This SDK interacts with the Go backend ecosystem created by the open-source community:
- whatsmeow — The underlying Go library created by Tulir Asokan that reverse-engineers the WhatsApp Web Multi-Device WebSocket protocol and Signal encryption.
- go-whatsapp-web-multidevice (GOWA) — The lightweight REST API wrapper created by Aldino Kemal exposing
whatsmeowover HTTP and Webhooks. - OpenAPI Specification — Official GOWA OpenAPI 3.0 specification (View in Swagger Editor).
Installation
Requirements
- A running instance of GOWA (go-whatsapp-web-multidevice) REST server
- PHP >= 8.2
jsonandhashextensions- PSR-18 compliant HTTP Client or Guzzle Client
Usage Example
1. Initialize Configuration and Client
2. Device Management & Pairing
3. Sending Messages and Media
Text, Links, Polls & Mentions
Media Uploads (Files, URLs, Mentions & View Once)
Scheduled & Recurring Message Sends (GOWA v9.5+)
Message Actions (Forward, Edit, Revoke, Reactions, Star & Chat History)
Media Download (Echo Candidate Phones, Timeout, and Cleanup)
4. Webhook Verification & Event Parsing
Available Features Summary
Device Management
| Feature | Method | Endpoint |
|---|---|---|
| Register Device & Webhook | createDevice() |
POST /devices |
| List Registered Devices | devices(), listDevices() |
GET /devices |
| Update Webhook Config | updateWebhook() |
PATCH /devices/:id/webhook |
| Start QR Pairing | startQrPairing() |
GET /devices/:id/login |
| Start 8-Digit Code Pairing | startCodePairing() |
POST /devices/:id/login/code |
| Query Device Info & Status | device() |
GET /devices/:id |
| Reconnect Device | reconnectDevice() |
POST /devices/:id/reconnect |
| Logout Device (Keep Slot) | logout() |
POST /devices/:id/logout |
| Purge / Delete Device Slot | deleteDevice() |
DELETE /devices/:id |
Messages & Interactions
| Feature | Method | Endpoint |
|---|---|---|
| Text Message (Mentions, Duration, Schedule) | sendText() |
POST /send/message |
| Image (Caption Mentions, View-Once, Schedule) | sendMedia() |
POST /send/image |
| Video (Caption Mentions, View-Once, Schedule) | sendMedia() |
POST /send/video |
| Audio / PTT Voice Note (Schedule) | sendMedia() (voice: true) |
POST /send/audio |
| Document / File (Caption Mentions, Schedule) | sendMedia() |
POST /send/file |
| WebP Sticker | sendSticker() |
POST /send/sticker |
| Location | sendLocation() |
POST /send/location |
| Contact Card | sendContacts() |
POST /send/contact |
| URL Link Preview | sendLink() |
POST /send/link |
| Interactive Poll | sendPoll() |
POST /send/poll |
| Emoji Reaction | sendReaction() |
POST /message/:id/reaction |
| Forward Message (Schedule) | forwardMessage() |
POST /message/:id/forward |
| Edit Message | editMessage() |
POST /message/:id/update |
| Revoke Message (Delete for All) | revokeMessage() |
POST /message/:id/revoke |
| Delete Message (Local) | deleteMessage() |
POST /message/:id/delete |
| Star / Unstar Message | starMessage() |
POST /message/:id/star, POST /message/:id/unstar |
| Mark Audio Played | markPlayed() |
POST /message/:id/played |
| Mark Read / Typing | markRead() |
POST /message/:id/read |
| On-Demand Chat History | requestChatHistory() |
POST /chat/:jid/history |
Scheduled & Recurring Sends (GOWA v9.5+)
| Feature | Method | Endpoint |
|---|---|---|
| List Scheduled Sends | listSchedules() |
GET /send/schedules |
| Get Scheduled Send | getSchedule() |
GET /send/schedules/:id |
| Pause Scheduled Send | pauseSchedule() |
POST /send/schedules/:id/pause |
| Resume Scheduled Send | resumeSchedule() |
POST /send/schedules/:id/resume |
| Cancel Scheduled Send | cancelSchedule() |
POST /send/schedules/:id/cancel |
Contacts, Presence & Media Download
| Feature | Method | Endpoint |
|---|---|---|
| Check User on WhatsApp | checkUser() |
GET /user/check |
| Contact Profile Picture | avatar() |
GET /user/avatar |
| Prepare Media Download | describeMedia() |
GET /message/:id/download |
| Download Decrypted Media | downloadMedia() |
GET media URL |
Error Handling
The SDK provides structured exceptions to clearly differentiate between network/transport unreachability, permanent media refusals, and server validation/refusal responses:
🔒 Security & Multi-Tenancy Considerations
Tenant Isolation & Device Scoping
- GOWA does not isolate tenants at the API level: A single Basic Auth credential provides access to all paired devices on the server.
deviceIdscoping: Every device-specific operation must be explicitly scoped by$deviceId. An invalid, empty, or missingdeviceIdwould cause requests to execute on whichever device the server chooses.- Validation: All methods accepting
$deviceIdstrictly reject empty or whitespace-only strings withInvalidArgumentExceptionbefore any network request is issued. - Caller responsibility: The
$deviceIdmust always originate from trusted server storage (e.g. your database model) and never directly from unvalidated user input or request parameters. - Un-scoped endpoints: Broad reading endpoints (
/chats,/user/my/contacts,/user/my/groups) are not scoped per device on the GOWA server and return mixed data across all paired numbers. Avoid relying on them for tenant-isolated data.
Anti-SSRF Validation & Redirect Protection
Any media or QR image URL fetched through downloadMedia() or fetchQrImage() is strictly validated via GowaHost::assertBelongsToServer() to ensure requests only target the configured GOWA server. Furthermore, automatic HTTP redirects are explicitly disabled (allow_redirects: false) to prevent unvalidated redirects from escaping the configured host, protecting against SSRF attacks and credential leaks.
Running Tests (Pest PHP)
⚠️ Disclaimer & Terms of Use
This software is an open-source library created for educational, research, and testing laboratory purposes.
- Third-Party Terms of Service: Users of this library are solely responsible for complying with WhatsApp's Terms of Service, Meta's Platform Policies, and the terms of any third-party services utilized.
- Automated Messaging & Policy Compliance: Automated or unauthorized messaging may violate platform terms. Users must ensure strict compliance with applicable privacy laws (e.g., GDPR, LGPD), user consent requirements, and platform guidelines.
- No Warranty & Liability: This software is provided "as is", without warranty of any kind, express or implied. The authors and contributors assume no liability for any account bans, data loss, service interruptions, or misuse of this library.
Contributing
Please see CONTRIBUTING.md and CODE_OF_CONDUCT.md for details.
License
This package is open-source software licensed under the MIT License.
All versions of sdk with dependencies
ext-json Version *
ext-hash Version *
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
guzzlehttp/guzzle Version ^7.8 || ^8.0