Delete a Malop Label
Endpoint URL: https://<your server>/rest/detection/delete-labels
Endpoint URI: detection/delete-labels
Action: POST
Deletes an existing Malop label from the list of labels available for use to add to Malops.
This request is supported for versions 20.1.43 and later.
Note
Ensure that you have logged into the Cybereason platform. For details, see Log in with the API.
Request Headers
Add an Content-Type:application/json header with the request.
Note
If you are using cURL, add the authorization cookie details or the path to the file containing the cookie details as part of every request.
Request Body
Input: Text
[<label id>]
Request Parameters
URL/URI parameters: none
Request Body Parameters: Add the integer value for the label id in square brackets.
Response Status Codes
This request can return the following status codes:
200: Success OK or an error message saying why
Response Success Schema
The response contains a message reporting success.
Response Failure Schema
The response contains a message containing details on the failure.
Important Response Fields
The response contains only the status for delete operation. View that status.
Example: Delete a Malop label
Request
curl --request GET \
--url https://12.34.56.78/rest/detection/delete-label \
--header 'Content-Type:application/json' \
--data '[3]'
Response
{"success"}
Request
Download example Python script
Depending on your browser settings, this linked file may open in a separate tab instead of downloading directly to your machine. If this happens, use the Save As option in your browser to save the file locally.
import requests
import json
# Login information
username = "[email protected]"
password = "mypassword"
server = "yourserver.com"
port = "443"
data = {
"username": username,
"password": password
}
headers = {"Content-Type": "application/json"}
base_url = "https://" + server + ":" + port
login_url = base_url + "/login.html"
session = requests.session()
login_response = session.post(login_url, data=data, verify=True)
print (login_response.status_code)
print (session.cookies.items())
# Request URL
endpoint_url = "/rest/detection/delete-label"
api_url = base_url + endpoint_url
api_headers = {'Content-Type':'application/json'}
# These are the parameters for the request.
label_id = 3
query = [label_id]
api_response = session.request("POST", api_url, data=query, headers=api_headers)
your_response = json.loads(api_response.content)
print(json.dumps(your_response, indent=4, sort_keys=True))
Response
{"success"}