Web Application Report

[POST] /qps/rest/3.0/create/was/report

Using the Report Creation API you can create the Web Application Report.

Permissions required - User must have WAS module enabled. User account must have these permissions: Access Permission “API Access” and “Create Report”.

Note: Report creation may sometimes fail if the report is created for large number of web applications. To avoid such failures, we have now categorized report creation as per the number of web applications being included in the report. For web applications less than or equal to 500, you can create the report. But if the number of web applications exceeds 500, the report cannot be created and an error message is displayed in such cases.

The categorization is as follows:

Number of Web Applications

Create Report (API)

Less than or equal to 500

Yes

More than 500

No

Input ParametersInput Parameters

These elements are optional and act as filters. When multiple elements are specified, parameters are combined using a logical AND.

Click here for available operators

Parameter

Mandatory

/Optional

Data Type

Description

name

Optional

text

Name of the report.

Note: Generating a report without template will allow you to assign a name to the report. If you use template during report generation, the name you provide in the request is ignored and the template name is assigned to the report.

type

Optional

keyword

Type of the report, one of: WAS_SCAN_REPORT, WAS_WEBAPP_REPORT, WAS_SCORECARD_REPORT,  WAS_CATALOG_REPORT

format

Optional

keyword

Report format, one of: WORD, HTML_ZIPPED, HTML_BASE64, PDF, PDF_ENCRYPTED, CSV, CSV_V2, XML, POWERPOINT

template.id

Optional

integer

The template ID. This element is assigned by the system and is required for a certain type of request.

config*(1)

Optional

 

The “config” element must have one and only one of these child elements: webAppReport, scanReport, catalogReport or scorecardReport. Refer to Reference: Report  for more details.

tags.id

Optional

integer

ID of the tag associated with the web application.

password

Optional

text

The password for a PDF encrypted report.

Sample - Create web app report - minimum criteriaSample - Create web app report - minimum criteria

Let us create a web application report in encrypted PDF format, setting both tags and web applications for the target.

API request

curl -u "USERNAME:PASSWORD" -H "content-type: text/xml" -X "POST" --data-binary @-
"<qualys_base_url>/qps/rest/3.0/create/was/report" < file.xml
Note: “file.xml” contains the request POST data.      
    

Request POST data

<ServiceRequest>
    <data>
        <Report>
            <name>
                <![CDATA[API Web Application Report]]>
            </name>
            <description>
                <![CDATA[PDF WebApp report]]>
            </description>
            <format>PDF</format>
            <type>WAS_WEBAPP_REPORT</type>
            <config>
                <webAppReport>
                    <target>
                        <webapps>
                            <WebApp>
                                <id>8223303</id>
                            </WebApp>
                        </webapps>
                    </target>
                </webAppReport>
            </config>
        </Report>
    </data>
</ServiceRequest>      
    

XML response

<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="<qualys_base_url>/qps/xsd/3.0/was/report.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <data>
        <Report>
            <id>1085046</id>
        </Report>
    </data>
</ServiceResponse>  
    

Sample - Create a web application report - use tags as targetSample - Create a web application report - use tags as target

Let us create a web application report using tags to add web applications as target for the report.

API request

curl -u "USERNAME:PASSWORD" -H "content-type: text/xml" -X "POST" --data-binary @-
"<qualys_base_url>/qps/rest/3.0/create/was/report" < file.xml
Note: “file.xml” contains the request POST data.      
    

Request POST data

<ServiceRequest>
    <data>
    <Report>
        <name>
        <![CDATA[Web App Report]]>
        </name>
        <format>PDF</format>
        <type>WAS_WEBAPP_REPORT</type>
        <config>
        <webAppReport>
            <target>
            <tags>
                <included>
                <option>ALL</option>
                <tagList>
                    <Tag>
                    <id>12008216</id>
                    </Tag>
                </tagList>
                </included>
                <excluded>
                <option>ANY</option>
                <tagList>
                    <Tag>
                    <id>12008219</id>
                    </Tag>
                </tagList>
                </excluded>
            </tags>
            </target>
        </webAppReport>
        </config>
    </Report>
    </data>
</ServiceRequest>      
    

XML response

<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="<qualys_base_url>/qps/xsd/3.0/
was/report.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <data>
        <Report>
            <id>981654</id>
        </Report>
    </data>
</ServiceResponse>      
    

Sample - Create a web application report using report templateSample - Create a web application report using report template

Let’s generate a web application report in PDF format using a specific template (identified by its template ID).

API request

curl -u "USERNAME:PASSWORD" -H "content-type: text/xml" -X "POST" --data-binary @-
"<qualys_base_url>/qps/rest/3.0/create/was/report/" < file.xml
Note: “file.xml” contains the request POST data.      
    

Request POST data

<ServiceRequest>
    <data>
    <Report>
        <name>Web_App_Report</name>
        <description>
        <![CDATA[A web application report]]>
        </description>
        <type>WAS_WEBAPP_REPORT</type>
        <format>PDF</format>
        <config>
        <webAppReport>
            <target>
            <tags>
                <included>
                <option>ALL</option>
                <tagList>
                    <Tag>
                    <id>12001856</id>
                    </Tag>
                </tagList>
                </included>
                <excluded>
                <option>ANY</option>
                <tagList>
                    <Tag>
                    <id>12001856</id>
                    </Tag>
                </tagList>
                </excluded>
            </tags>
            </target>
        </webAppReport>
        </config>
        <template>
        <id>876048</id>
        </template>
    </Report>
    </data>
</ServiceRequest>      
    

XML response

<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="<qualys_base_url>/qps/xsd/3.0/
was/report.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <data>
        <Report>
            <id>973056</id>
        </Report>
    </data>
</ServiceResponse>      
    

Sample - Create a web application report using CSV_V2 formatSample - Create a web application report using CSV_V2 format

Let’s generate a web application report in CSV_V2 format.

API request

curl -u "USERNAME:PASSWORD" -H "content-type: text/xml" -X "POST" --data-binary @-
"<qualys_base_url>/qps/rest/3.0/create/was/report/" < file.xml
Note: “file.xml” contains the request POST data.      
    

Request POST data

<ServiceRequest>
    <data>
        <Report>
            <name>
                <![CDATA[Web Application Report for Servers]]>
            </name>
            <format>CSV_V2</format>
            <template>
                <id>46440</id>
            </template>
            <config>
                <webAppReport>
                    <target>
                        <webapps>
                            <WebApp>
                                <id>470281</id>
                            </WebApp>
                        </webapps>
                    </target>
                </webAppReport>
            </config>
        </Report>
    </data>
</ServiceRequest>      
    

XML response

<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="<qualys_base_url>/qps/xsd/3.0/was/report.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <data>
        <Report>
            <id>214158</id>
        </Report>
    </data>
</ServiceResponse>      
    

 XSD

<platform API server>/qps/xsd/3.0/was/report.xsd