Use this code to integrate Email Hippo’s MORE API using PHP.



/*

 *******************************************************************************************

 * Company:

 * © 2017, Email Hippo Limited. (http://emailhippo.com)

 *

 * File name:

 * API V3 - PHP Example.php

 *

 * Version:

 * 1.0.20170508.0

 *

 * Version control:

 * - 1.0.20170508.0 - initial release

 *

 * Date:

 * August 2014

 *

 * Description:

 * Demonstrates how to call a RESTful service @ //api.hippoapi.com/v3/more/json

 * using PHP.

 *

 * This example requires a valid key to work correctly.

 *

 * License:

 * Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0)

 *******************************************************************************************

*/


<?php

 

// URL which should be requested

$url = 'https://api.hippoapi.com/v3/more/json';

 

$apikey = 'YOUR API KEY'; // API Key

 

$email = 'Email Address to Test'; // Email to test

 

// jSON String for request

$url .= "/$apikey/$email";

 

// Initializing curl

$ch = curl_init( $url );

 

if($ch == false) {

     die ("Curl failed!");

} else {

 

  // Configuring curl options

  $options = array(

      CURLOPT_RETURNTRANSFER => true,

      CURLOPT_HTTPHEADER => array('Content-type: application/json')

  );

   

  // Setting curl options

  curl_setopt_array( $ch, $options );

   

  // Getting results

  $result = curl_exec($ch); // Getting jSON result string

   

  // display JSON data

  echo "$result";

   

}

 

?>