API service provides the way to delete subscriber without physically accessing the MUMARA. Following is the essential Json document formation to submit the request, with a sample request towards the end of the section, demonstrating the sample code to delete the subscriber.
Username |
The email that account holder uses to login MUMARA |
API Token |
The API token user has generated using API Configuration section of MUMARA, also mentioned above. |
Method |
Method being called (Post) |
Path |
Path to the API file being called ('http//www.yourdomain.com/API/deleteSubscriber) |
Label/ Variable |
Priority |
Description |
subscriber_id |
Required |
Subscriber ID is required to delete particular subscriber using API request |
Following is the sample request for deleting subscriber with the Subscriber ID “2”.
$postData['subscriber_id'] = '2';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,'http://www.yourdomain.com/API/deleteSubscriber');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_POST, count($postData));
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'APIToken: 343b1b831067b50e308e6bf93e0f06f0', 'Login: [email protected]'));
$data = curl_exec($ch);
if (curl_errno($ch)) {
print "Error: " . curl_error($ch);
} else {
// Show me the result
print ($data);
curl_close($ch);
}
Upon providing appropriate information along with correct Subscriber ID, required subscriber will be deleted and you will get success response as below.
Status value for the successfully deleted subscriber will be- “success” Data Returned-"Subscriber ID"
{"status":"success","response":{"Subscriber ID":"2"}}
When you submit request with inappropriate, incorrect information.
Status value for unsuccessful submission will be-"error”
Data Returned-
Text based message describing reason of unsuccessful response
Here is an example of erroneous response.
{"status":"error","response":"Subscriber not available to delete"}