yama / newwaapi-php-lib
This is library for newwaapi https://github.com/yama24/newwaapi
1.2.4
2025-09-02 13:14 UTC
Requires
- php: ^5.6|^7.0|^8.0
- ext-curl: *
- ext-json: *
- ext-mbstring: *
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
This is PHP library for newwaapi
This version of library related to newwaapi latest release
Installation
Install with composer
composer require yama/newwaapi-php-lib
Usage/Examples
<?php require_once __DIR__ . "/vendor/autoload.php"; use Yama\NewwaapiPhpLib\Newwaapi; $wa = new Newwaapi("http://localhost:8000/");
for information of connection
echo $wa->info();
for send message to contact
echo $wa->sendMessage('6281292267204', 'example message');
| Parameter | Type | Description |
|---|---|---|
number |
string |
Required. 6281292267204 |
message |
string |
Required. example message |
for send message to group
echo $wa->sendGroupMessage('628986182128-1627374981@g.us', 'example group message');
| Parameter | Type | Description |
|---|---|---|
id |
string |
Required. 628986182128-1627374981@g.us |
message |
string |
Required. example group message |
for send media to contact or group
echo $wa->sendMedia('6281292267204', "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6b/WhatsApp.svg/479px-WhatsApp.svg.png", 'example media caption', '');
| Parameter | Type | Description |
|---|---|---|
number |
string |
Required. 6281292267204 (you can use a number or group id) |
file |
string |
Required. (you can fill it with base64 url data / url) |
caption |
string |
example media caption (you can fill with empty string) |
name |
string |
example document file name (work for document file, you can fill with empty string) |
for check the number is registered on WhatsApp or not
echo $wa->isRegistered('6281292267204');
| Parameter | Type | Description |
|---|---|---|
number |
string |
Required. 6281292267204 |
for get the list of groups
echo $wa->getGroups();
for get the list of config
echo $wa->getConfig();