PHP code example of yama / newwaapi-php-lib

1. Go to this page and download the library: Download yama/newwaapi-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 / newwaapi-php-lib example snippets




ama\NewwaapiPhpLib\Newwaapi;

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

echo $wa->info();
 

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

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

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

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

echo $wa->getGroups();
 

echo $wa->getConfig();
 
bash
  composer