AnsweredAssumed Answered

API V2: How to download scan report in JSON?

Question asked by Mohamed Lrhazi on Sep 2, 2015
Latest reply on Sep 4, 2015 by Mohamed Lrhazi

The User Guide, page 350, says:

 

Vulnerability Scan Results

The vulnerability scan results is returned from the download vulnerability scan results

API call. Vulnerability scan results can be downloaded in these formats: CSV and JSON

(JavaScript Object Notation). The scan results will be in brief or extended format.

 

How do I specify JSON for output format for the fetch call? when I try adding output_format=json as a parameter, I get an error:

 

qgc = qualysapi.connect()

call = '/api/2.0/fo/report'

 

parameters = {'action': 'fetch', 'id': report_id, 'output_format':'json'}

 

report = qgc.request(call, parameters)

 

Error! Received a 4XX client error or 5XX server error response.

Content =

<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE SIMPLE_RETURN SYSTEM "https://qualysapi.qualys.com/api/2.0/simple_return.dtd">

<SIMPLE_RETURN>

  <RESPONSE>

    <DATETIME>2015-09-02T18:48:33Z</DATETIME>

    <CODE>1901</CODE>

    <TEXT>Unrecognized parameter(s): output_format (action=fetch allows: echo_request, id)</TEXT>

  </RESPONSE>

</SIMPLE_RETURN>

ERROR:qualysapi.connector:Content =

<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE SIMPLE_RETURN SYSTEM "https://qualysapi.qualys.com/api/2.0/simple_return.dtd">

<SIMPLE_RETURN>

  <RESPONSE>

    <DATETIME>2015-09-02T18:48:33Z</DATETIME>

    <CODE>1901</CODE>

    <TEXT>Unrecognized parameter(s): output_format (action=fetch allows: echo_request, id)</TEXT>

  </RESPONSE>

</SIMPLE_RETURN>

Outcomes