PHP code example of yama / mywaapi-php-lib

1. Go to this page and download the library: Download yama/mywaapi-php-lib library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

yama / mywaapi-php-lib example snippets




ama\MywaapiPhpLib\Mywaapi;

$wa = new Mywaapi("http://localhost:8000/");

echo $wa->sendMessage('6281292267204', 'example message');
 

echo $wa->info();
 

echo $wa->isRegistered("6281292267204");
 

echo $wa->setWebhook("https://webhook.site/365b1f55-5334-48e0-8380-91443516515b");
 

echo $wa->getWebhook();
 

echo $wa->sendMedia('6281292267204', 'example media caption', "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6b/WhatsApp.svg/479px-WhatsApp.svg.png");
 

echo $wa->sendGroupMessage('[email protected]', 'example group message');
 

echo $wa->clearMessage('6281292267204');
 

echo $wa->deleteChat('6281292267204');
 
bash
  composer