yama / mywaapi-php-lib
This is library for mywaapi https://github.com/yama24/mywaapi
1.1.0
2022-07-11 04:59 UTC
Requires
- php: ^7.3
- ext-curl: *
- ext-json: *
- ext-mbstring: *
README
This is PHP library for mywaapi
Installation
Install with composer
composer require yama/mywaapi-php-lib
Usage/Examples
<?php require_once __DIR__ . "/vendor/autoload.php"; use Yama\MywaapiPhpLib\Mywaapi; $wa = new Mywaapi("http://localhost:8000/");
for send message to contact
echo $wa->sendMessage('6281292267204', 'example message');
for information of connection
echo $wa->info();
for check the number is registered or not
echo $wa->isRegistered("6281292267204");
for set the webhook/callback
echo $wa->setWebhook("https://webhook.site/365b1f55-5334-48e0-8380-91443516515b");
for get the webhook/callback
echo $wa->getWebhook();
for send media to contact or group
echo $wa->sendMedia('6281292267204', 'example media caption', "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6b/WhatsApp.svg/479px-WhatsApp.svg.png");
for send message to group
echo $wa->sendGroupMessage('628986182128-1627374981@g.us', 'example group message');
for clear all message in the chat
echo $wa->clearMessage('6281292267204');
for delete chat
echo $wa->deleteChat('6281292267204');