Add Malop Comment
Endpoint URL: https://<your server/rest/crimes/comment/:malopID
Endpoint URI: crimes/comment/:malopID
Action: POST
Adds a comment to the specified Malop.
Note
Ensure that you have logged into the Cybereason platform. For details, see Log in with the API.
Request Headers
You must 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 with cookie details with every request.
Request Body
Input: JSON
<comment to add>
Note
You do not need to add quotes around this request.
Request Parameters
URL/URI parameters: Add the required malopID to the URL.
Request Body Parameters: You must provide a string with the comment.
Response Success Schema
A message indicating the successful addition of the comment.
Response Failure Schema
None
Example: Add a Malop comment
curl --request POST \
--url https://12.34.56.78/rest/crimes/comment/11.-4417342166587998772 \
--header 'Content-Type:text/plain' \
--data '{
Checked into Virus Total - no report
}'
Request
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.
Use this request body:
{
Checked into Virus Total no report
}
Request
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
malop_id = 11.-4417342166587998772
endpoint_url = "/rest/crimes/comment/"
api_url = base_url + endpoint_url + str(malop_id)
api_headers = {'Content-Type':'application/json'}
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))