PHP code example of alexeevdv / yii2-zerobounce-client

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

    

alexeevdv / yii2-zerobounce-client example snippets


'container' => [
    'singletons' => [
        alexeevdv\yii\zerobounce\ClientInterface::class => [
            'class' => alexeevdv\yii\zerobounce\Client::class,
            'apiKey' => 'a95c530a7af5f492a74499e70578d150',         
        ],
    ],
],

$client = yii\di\Instance::ensure(alexeevdv\yii\zerobounce\ClientInterface::class);
$result = $client->validate('[email protected]');
if ($result->isValid()) {
    // do your stuff
}

$client = yii\di\Instance::ensure(alexeevdv\yii\zerobounce\ClientInterface::class);
$credits = $client->getCredits();

$client = yii\di\Instance::ensure(alexeevdv\yii\zerobounce\BulkClientInterface::class);
$result = $client->sendFile('file.csv', 'http://site.com/your-postback-link/');

$client = yii\di\Instance::ensure(alexeevdv\yii\zerobounce\BulkClientInterface::class);
//File uuid received from sendFile response
$result = $client->readFile($uuid);

$client = yii\di\Instance::ensure(alexeevdv\yii\zerobounce\BulkClientInterface::class);
//File uuid received from sendFile response
$result = $client->deleteFile($uuid);