Not able to generate and download the report using API in curl

@onkar_jog Not sure if it was a copy/paste issue, but did you make sure the -X option was used when running the report generation to define the POST method?

I just used a lab environment and was able to run the following curl requests to create and generate the report with the same payload you provided:

> curl -k -XPOST https://<IP OR HOST>:3780/api/3/reports -H "Content-Type: application/json" --user "<USERNAME>:<PASSWORD>" -d '{"severity":"all", "scope":{"assets":[23]}, "name":"test-scan-report-5", "template":"basic-vulnerability-check-results", "format":"csv-export"}' 

# Using recently created report ID
> curl -k -XPOST https://<IP OR HOST>:3780/api/3/reports/566919/generate -H "Content-Type: application/json" --user "<USERNAME>:<PASSWORD>"

We also have an example Python script for bulk extracting data from the console that might be handy for you. Would likely need modified for your needs but could be a good starting point:

2 Likes