Forked from itabrezshaikh/listclean.xyz single api curl example.php
Created
August 20, 2023 16:44
-
-
Save fhferreira/6da905fa892e3f1c961815ef2c9ef47a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
try{ | |
$url = "https://api.listclean.xyz/v1/"; | |
$endpoint = 'verify/email/'; | |
$api_key = YOUR_API_KEY; | |
$email = '[email protected]'; | |
$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] => [email protected] | |
[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