try {
// Set the REST API URL
$restURL = "https://api.enginemailer.com/restapi/subscriber/emsubscriber/getCustomField";
// Initiate the cURL Method with the REST API URL Specified Previously.
$client = curl_init($restURL);
// Add APIKey into the Headers to be passed in.
$headers = array(
"APIKey : "
);
// Return the Transfer as String
curl_setopt($client, CURLOPT_RETURNTRANSFER, true);
// Use POST Method
curl_setopt($client, CURLOPT_HTTPGET, true);
// Add Headers for Request
curl_setopt($client, CURLOPT_HTTPHEADER, $headers);
// Calls the Rest API
$curl_response = curl_exec($client);
$curlJson = json_decode($curl_response);
$jsonData = $curlJson->Result->Data;
foreach($jsonData as $obj){
echo "Custom Field Key: " . $obj->customfield_key . "";
echo "Custom Field Name: " . $obj->customfield_name . "";
echo "Custom Field Type: " . $obj->customfield_type . "";
echo "";
}
curl_close($client);
}
catch (Exception $e)
{
echo 'Caught exception: ', $e->getMessage(), "\n";
}
catch (Exception $e)
{
echo 'Caught exception: ', $e->getMessage(), "\n";
}