Download the CSV for a data extract

This will download the CSV file for a Data Extract.

get
data-extracts/{id}/download

https://console.automox.com/api/data-extracts
This endpoint will trigger an automatic download through the API for the file stored in S3.
Request
Response
Request
Path Parameters
id
required
integer
ID of the data extract to download
Headers
Authentication
required
string
Your Automox API Key for authentication. Format: Authentication: Bearer your_automox_api_key
Query Parameters
o
required
integer
The Organization whose data extract you want to download.
Response
302: Found
Redirects to download file when found.

Example Requests

cURL
Python http.client
Python requests
C#
PowerShell
cURL
curl --location --request GET 'https://console.automox.com/api/data-extracts/156/download?o=1234' \
--header 'Authorization: Bearer your_automox_api_key' \
Python http.client
import http.client
conn = http.client.HTTPSConnection("console.automox.com")
payload = ''
headers = {
'Authorization': 'Bearer your_automox_api_key'
}
conn.request("GET", "/api/data-extracts/156/download?o=1234", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Python requests
import requests
url = "https://console.automox.com/api/data-extracts/156/download?o=1234"
payload={}
headers = {
'Authorization': 'Bearer your_automox_api_key'
}
response = requests.request("GET", url, headers=headers, data=payload, allow_redirects=True)
print(response.text)
C#
var client = new RestClient("https://console.automox.com/api/data-extracts/156/download?o=1234");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer your_automox_api_key");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
PowerShell
$apiKey = 'your_automox_api_key'
$headers = @{ "Authorization" = "Bearer $apiKey" }
$url = 'https://console.automox.com/api/data-extracts/<report_id>/download?o=<org_id>'
Invoke-WebRequest -Method Get -Uri $url -Headers $headers -OutFile "$env:userprofile\Downloads\patch-history_report.csv"