Method: DELETE
Endpoint: /api/deleteCustomField/{id}/{force}
Parameter | Type | Description |
status | JSON | Success or Error |
result | JSON | Result of the operation |
response | JSON | Output of the operation |
<?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/deleteCustomField/';
//Custom field id
$id = '13/';
//flag force
$force = 1;
// Defining cURL Request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$domain.$endpoint.$id.$force);
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);
?>
{
"status": "success",
"result": "Success: Custom field has been successfully deleted."
}
{
"status": "error",
"result": "Error: Please unassign custom field from the associated lists before it can be deleted. Otherwise you can forcibly delete custom field by parsing force=1."
}