Stop a File Download Operation
Endpoint URL: https://<your server>/rest/fetchfile/close/:batchID
Endpoint URI: fetchfile/close/:batchID
Action: GET
Aborts a file download operation that is in progress. You must also send a request to get the operation batch number for the file download. For details on these requests, see Get a Download Batch Number.
Note
Before running this request, 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
None
Request Parameters
URL/URI parameters: none
Request Body Parameters: none
Response Status Codes
This request can return the following status codes:
200: Success OK
Response Success Schema
The response can contain any of the following fields:
Field |
Type |
Description |
---|---|---|
data |
Boolean |
Indicates whether there is a response. |
status |
Enum |
The status of the file download start operation. Possible values include:
|
message |
String |
The message received from the server about this operation. |
Response Failure Schema
None
Example: Stop a file download
Request
curl --request GET \ --url https://12.34.56.78/rest/fetchfile/close/1638177597 \ --header 'Content-Type:application/json' \
Response
{
"data":true,
"status":"SUCCESS",
"message":""
}
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
batch_id = 1638177597
endpoint_url = "rest/fetchfile/stop/" + str(batch_id)
api_url = base_url + endpoint_url
api_headers = {'Content-Type':'application/json'}
api_response = session.request("GET", api_url, headers=api_headers)
your_response = json.loads(api_response.content)
print(json.dumps(your_response, indent=4, sort_keys=True))
Response
{
"data":true,
"status":"SUCCESS",
"message":""
}