Method: DELETE
Endpoint: /api/deleteListGroup/{group_id}/{delete_lists}
Parameters
Parameter |
Type |
Required |
Description |
group_id |
int |
Yes |
id of the group to be deleted |
delete_lists |
0, 1 (default: 0) |
No |
1 = Also delete all contact lists inside the group. Otherwise, contact lists will be moved to unsorted |
Response Parameters
Parameter |
Type |
Description |
status |
JSON |
Success or Error |
result |
JSON |
Result of the operation |
Example Request (CURL)
<?php
// Authentication
$api_token = 'API_KEY'; // Mumara API Key (can be found in Settings -> API Key)
$domain = 'http://www.anydomain.com'; // Your Mumara Domain Name
// API Endpoint
$endpoint = '/api/deleteListGroup/';
//group id
$group_id = '13/';
//flag delete list
$delete_list = 1;
// Defining cURL Request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$domain.$endpoint.$group_id.$delete_list);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($ch, CURLOPT_HTTPHEADER,
array('Content-Type: application/json', 'Authorization: Bearer ' . $api_token));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Executing cURL
$output = curl_exec ($ch);
// Printing Output
echo "<pre>";
echo json_encode(json_decode($output),JSON_PRETTY_PRINT);
// Closing cURL
curl_close ($ch);
?>
Example Response (JSON)
{
"status": "success",
"result": "Success: Contact List Group has been successfully deleted."
}
Status value of the success response will be "success"
Example Error Response (JSON)
{
"status": "error",
"result": "Error: Group doesn't exist."
}
Possible Errors
- Invalid contact list group id
- Access denied