Download the PHP package waapi/waapi-php-sdk without Composer
On this page you can find all versions of the php package waapi/waapi-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package waapi-php-sdk
WaAPI PHP Package
Introduction
PHP package to easily interact with waapi.app.
Installation
Composer
Usage
Initial Setup
Check if WhatsApp API is available
Create a new instance
Get an existing instance
Update an existing instance
Delete an existing instance
Get the QR-Code
After creating a new instance, you need to connect your WhatsApp phone number with this instance. With the following code, you are able to receive the current QR-Code.
Get the instance status
An instance always has a status.
| Status | Description |
|---|---|
| booting | The node is starting the instance. The status will change to loading_screen soon. |
| loading_screen | The instance is starting WhatsApp Web. The status will change to qr or ready soon. |
| qr | The instance needs to be connected with a WhatsApp phone number. You can fetch the QR code now. |
| authenticated | The connection via the QR code was successful. The status will change to ready soon. |
| auth_failure | The connection via the QR code failed or WhatsApp Web is down. |
| ready | The instance is ready to use. You are able to execute actions and send messages. |
| disconnected | Disconnected from WhatsApp Web |
Get information about an existing instance
Execute actions
Once your instance is in ready state, you can execute WhatsApp actions:
Common actions: send-message, send-media, send-location, send-vcard, get-chats, get-contacts, get-contact-by-id, is-registered-user, get-number-id, send-seen, logout, reboot.
For a full list of available actions and their parameters, see the API documentation.
Webhook events
When configuring webhooks, use the WebhookEvent class for available event constants:
| Event | Description |
|---|---|
message |
Fired when you receive a message |
message_create |
New message created (sent and received) |
message_edit |
A message was edited |
message_ack |
Message was read or received |
message_reaction |
Reaction sent, received, updated or removed |
message_revoke_everyone |
Message deleted for everyone |
message_revoke_me |
Message deleted for you only |
media_uploaded |
Media file uploaded successfully |
qr |
New QR code available |
authenticated |
Connection successfully established |
auth_failure |
Authentication failed |
ready |
Instance is ready to use |
disconnected |
Instance was disconnected |
loading_screen |
Instance is loading data |
change_state |
Connection status changed |
group_join |
Someone joined or was added to a group |
group_leave |
Someone left or was removed from a group |
group_update |
Group information was updated |
call |
Incoming call (cannot be handled by API) |
vote_update |
Poll vote was updated or removed |
License
The MIT License (MIT). Please see License File for more information.