Report
Generate PDF reports.
This endpoint is currently in beta and subject to change.
Generate Report
GET
https://api.halosecurity.com/api/v1/report/generate.json
Initiate the report generator. After a successful call, the work_id
can be monitored to determine when the report is ready. The file_id
can then be used to download the file.
https://app.halosecurity.com/user/security/report/
{
"success": 1,
"work_id": "[ID]",
"file_id": "[ID]"
}
Common Parameters
id
String
none
Required. See reports below.
expire_days
Integer
7
File will be deleted after this many days.
theme
String
dark
The color scheme of the PDF: light
or dark
.
folder
String
none
Folder name to put the file in.
filename
String
dyanmic
Override the default filename for the report.
Report - Executive Summary
id
String
executive-summary
Report - Target
id
String
target
target_id
Integer
Required.
Report - Issue
id
String
issue
issue_id
Integer
Required.
Report - Security
id
String
security
scan_id
String
Optional. Defaults to the most recent scan.
Report - Remediation
id
String
remediation
date_start
String
YYYY-MM-DD
date_end
String
YYYY-MM-DD
Report - Dark Web
id
String
darkweb
domain_id
Integer
Optional. Supports multiple. Restricts report to these domains.
Example
#!/bin/bash
KEY="YOUR-API-KEY-HERE"
HOST="api.halosecurity.com"
### INITIATE REPORT GENERATOR
JSON=$(curl -s --header "x-apikey: $KEY" "https://$HOST/api/v1/report/generate.json?id=executive-summary")
WORK_ID=$(echo $JSON | jq -r .work_id)
FILE_ID=$(echo $JSON | jq -r .file_id)
echo "report work id $WORK_ID"
echo "report file id $FILE_ID"
### WAIT FOR REPORT COMPLETE
while true; do
sleep 1
echo report working
JSON=$(curl -s --header "x-apikey: $KEY" "https://$HOST/api/v1/work/get.json?id=$WORK_ID")
DONE=$(echo $JSON | jq -r .work.complete)
if [ $DONE == 1 ]; then
echo pdf ready
break
fi
done
### WAIT FOR REPORT FILE PROCESSING
while true; do
sleep 1
echo report file processing
JSON=$(curl -s --header "x-apikey: $KEY" "https://$HOST/api/v1/file/get.json?file_id=$FILE_ID")
DONE=$(echo $JSON | jq -r .file.ready)
if [ $DONE == 1 ]; then
echo file ready
echo $JSON | jq
URL=$(echo $JSON | jq -r .file.url)
break
fi
done
### DOWNLOAD REPORT FILE
echo "Downloading File $URL"
curl --header "x-apikey: $KEY" $URL > report.pdf
ls -lah report.pdf
Last updated
Was this helpful?