Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fhferreira/6da905fa892e3f1c961815ef2c9ef47a to your computer and use it in GitHub Desktop.
Save fhferreira/6da905fa892e3f1c961815ef2c9ef47a to your computer and use it in GitHub Desktop.
<?php
try{
$url = "https://api.listclean.xyz/v1/";
$endpoint = 'verify/email/';
$api_key = YOUR_API_KEY;
$email = 'listclean@example.com';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url . $endpoint . $email);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'X-AUTH-TOKEN: '. $api_key,
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
//var_dump($response);
$response = json_decode($response, true);
print_r($response);
//output
/*
Array
(
[success] => 1
[error_code] => 0
[message] => Email verification completed!
[data] => Array
(
[email] => listclean@example.com
[status] => dirty
[remarks] => Disposable Email
)
)
*/
}
catch(Exception $e){
die('Exception occurred error('.$e->getMessage().')');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment