PHP code example of accordous / z-api-client

1. Go to this page and download the library: Download accordous/z-api-client 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/ */

    

accordous / z-api-client example snippets


use Accordous\ZAPIClient\Services\ZAPIService;

$service = new ZAPIService($instanciaId, $instanciaToken);

$response = $service->instance()->situacao();

$result = $response->json();

use Accordous\ZAPIClient\Services\ZAPIService;

$service = new ZAPIService($instanciaId, $instanciaToken);

$response = $service->instance()->reiniciar();

$result = $response->json();

use Accordous\ZAPIClient\Services\ZAPIService;

$service = new ZAPIService($instanciaId, $instanciaToken);

$attributes = [
    'phone' => '5511999999999',
    'message' => 'Welcome to *Z-API*',
];

$response = $service->messages()->enviarTextoSimples($attributes);

$result = $response->json();
shell
php artisan vendor:publish --tag=Z-API