1. Go to this page and download the library: Download verifalia/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/ */
verifalia / sdk example snippets
use Verifalia\VerifaliaRestClient;
use Verifalia\VerifaliaRestClientOptions;
$verifalia = new VerifaliaRestClient([
VerifaliaRestClientOptions::USERNAME => 'your-username-here',
VerifaliaRestClientOptions::PASSWORD => 'your-password-here'
]);
use Verifalia\VerifaliaRestClient;
use Verifalia\VerifaliaRestClientOptions;
use Verifalia\Security\BearerAuthenticationProvider;
$verifalia = new VerifaliaRestClient([
VerifaliaRestClientOptions::AUTHENTICATION_PROVIDER =>
new BearerAuthenticationProvider('your-username-here', 'your-password-here')
]);
use Verifalia\VerifaliaRestClient;
use Verifalia\VerifaliaRestClientOptions;
$verifalia = new VerifaliaRestClient([
VerifaliaRestClientOptions::CERTIFICATE => '/home/gfring/Documents/pollos.pem'
]);
use Verifalia\VerifaliaRestClient;
$verifalia = new VerifaliaRestClient(...); // See above
// Verifies an email address
$job = $verifalia->emailValidations->submit('[email protected]');
// Print some results
$entry = $job->entries[0];
echo 'Classification: ' . $entry->classification;
echo 'Status: ' . $entry->status;
// Output:
// Classification: Deliverable
// Status: Success
$verifalia = new VerifaliaRestClient(...); // See above
$request = new ValidationRequest(...) // See above;
$job = $verifalia->emailValidations->submit($request, WaitOptions::$noWait);
echo 'Status: ' . $job->overview->status;
// Status: InProgress
use Verifalia\EmailValidations\ValidationOverview;
use Verifalia\EmailValidations\WaitOptions;
$verifalia = new VerifaliaRestClient(...); // See above
$request = new ValidationRequest(...) // See above;
$waitOptions = new WaitOptions(function (ValidationOverview $overview) {
echo 'Job status: ' . $overview->status;
if ($overview->progress !== null) {
echo 'Progress: ' . $overview->progress->percentage . '%';
}
});
$job = $verifalia->emailValidations->submit($request, $waitOptions);
$verifalia = new VerifaliaRestClient(...); // See above
$request = new ValidationRequest(...) // See above;
$request->completionCallback = new CompletionCallback('https://your-website-here/foo/bar');
$job = $verifalia->emailValidations->submit($request, $waitOptions);
// Exports the validated entries for the job in the CSV format
$export = $verifalia->emailValidations->exportEntries('722c2fd8-8837-449f-ad24-0330c597c993', ExportedEntriesFormat::CSV);
// Stores the binary string into a file
file_put_contents("my-list.csv", $export);