PHP code example of uaizap / sdk

1. Go to this page and download the library: Download uaizap/sdk 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/ */

    

uaizap / sdk example snippets




$client = new Uaizap\Sdk\UaizapClient('YOUR_INSTANCE_TOKEN');

$adminClient = Uaizap\Sdk\UaizapClient::createWithAdminToken('YOUR_ADMIN_TOKEN');

$instance = $adminClient->initInstance('my-new-instance');
$client->setToken($instance['token']);

$instances = $adminClient->listAllInstances();

$client->connectInstance();

$status = $client->status();

$adminClient->delete('INSTANCE_ID');

$client->logout();

$client->sendText('5511999999999', 'Hello, world!');

$client->sendImage('5511999999999', '/path/to/your/image.jpg');

$client->sendVideo('5511999999999', '/path/to/your/video.mp4');

$client->sendAudio('5511999999999', '/path/to/your/audio.mp3');

$client->sendDocument('5511999999999', '/path/to/your/document.pdf');