Below is an example of how to call the Email Warrant API using PHP:
<?php// get cURL resource$ch = curl_init();// set urlcurl_setopt($ch,CURLOPT_URL,'https://api.emailwarrant.com/v1/verify.php?userID=<USERID>&apiKey=<APIKEY>&domain=<DOMAIN>');// set methodcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');// return the transfer as a stringcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);// send the request and save response to $response$response = curl_exec($ch);// stop if failsif (!$response) {die('Error: "' . curl_error($ch) . '" - Code: ' . curl_errno($ch));}echo 'HTTP Status Code: ' . curl_getinfo($ch, CURLINFO_HTTP_CODE) . PHP_EOL;echo 'Response Body: ' . $response . PHP_EOL;// close curl resource to free up system resourcescurl_close($ch);?>
If you any issues getting set up with Email Warrant, please contact support@emailwarrant.com. We are always happy to help!