Delete Subscriber (delete)
<?php
//example PHP code to delete a subscriber
//set values of person to delete
$url_params['apiKey']="APIKEY_HERE";
$url_params['id']="SUBSCRIBERID_HERE";
$url = 'http://apidomain.com/api8/subscriber';
$url = sprintf("%s?%s", $url, http_build_query($url_params));
//Uses CURL DELETE request
$curl = curl_init($url);
curl_setopt ($curl, CURLOPT_CONNECTTIMEOUT, 100);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec ($curl);
curl_close ($curl);
echo $result;
//Parse the json to get return values.
$parsed_result = json_decode($result,false);
echo "<br><br>Status: $parsed_result->status";
echo "<br>Message: $parsed_result->message";
echo "<br>Error Code: $parsed_result->errorcode";
echo "<br>Error Message: $parsed_result->errormessage";
?>
Comments
0 comments
Article is closed for comments.