Following almost the same pattern of deleting subscriber, you can use the API service to delete list was well. Following section will elaborate it further with a sample request and returned Json responses both successful and unsuccessful.
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 |
Priority |
Description |
List ID |
Required |
The only required field to delete particular list is its ID. |
The sample code in the following section has valid API token, username and path to delete the list having list ID “8”.
$postData['list_id'] = '8';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,'http://www.yourdomain.com/API/deleteList');
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 such as API token, username, path and valid list ID, you will get your list deleted and will be given the following response.
Status value for successfully deleted List will be- “success”
Data Returned-"List ID"
{"status":"success","response":{"List ID":"8"}}
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
An example of error response is when you initiate the request without the list ID.
{"status":"error","response":"List ID is required to delete the list"}