https://github.com/mathsgod/whatsapp-client
https://github.com/mathsgod/whatsapp-client
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/mathsgod/whatsapp-client
- Owner: mathsgod
- License: mit
- Created: 2023-07-04T03:57:05.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-07-04T04:35:55.000Z (almost 3 years ago)
- Last Synced: 2025-05-13T22:24:13.702Z (about 1 year ago)
- Language: PHP
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WhatsApp Client
## Description
This is a simple WhatsApp client that uses the WhatsApp Web API to send and receive messages.
## Installation
```bash
composer require mathsgod/whatsapp-client
```
## Usage
You can generate token from https://business.facebook.com/settings/system-users/
Phone number id is not phone number, find it in https://developers.facebook.com/apps/{app_id}/whatsapp-business/wa-dev-console/
### Send a text message
```php
$wa = new WhatsApp\Client($token, $phone_number_id);
$wa->sendText("85298765432","Hello World!");
```
### Send a document
```php
$wa = new WhatsApp\Client($token, $phone_number_id);
$wa->sendDocument("85298765432",$url,"document.pdf");
```