Update Web Application

[POST] /qps/rest/3.0/update/was/webapp/<id>

Update a web application configuration in your account.

Note: The user can add URLs with non-standard TLDs in domain while updating a web application

Permissions required - User must have WAS module enabled. The user account must have these permissions: Access Permission “API Access” and WAS Asset Permission “Edit Web Asset”, "Edit Web Application URL," and "Select and Lock/Unlock Scanner Appliance." The output includes web applications in the user's scope. If you want to add Postman collection files, you must have the 'ENABLE_POSTMAN_COLLECTION' option enabled for your account. If this option is not enabled, contact Qualys Support to enable this option.

Input ParametersInput Parameters

The element “id” (integer) is required, where “id” identifies a web application.

Click here for available operators

Sample - Update the web app with the minimum informationSample - Update the web app with the minimum information

Let us update the information for the web application with ID 1234, and change the name to “My WebApp Name”.

API request

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

Request POST data

<ServiceRequest>
    <data>
        <WebApp>
            <name>My WebApp Name</name>
        </WebApp>
    </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/webapp.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <data>
        <WebApp>
            <id>1234</id>
        </WebApp>
    </data>
</ServiceResponse>

Sample - Update authentication records for the web appSample - Update authentication records for the web app

Let us update the web application with ID 1234, add 1 authentication record and remove 1 authentication record.

API request

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

Request POST data

<ServiceRequest>
    <data>
        <WebApp>
            <name>
                <![CDATA[My WebApp Name]]>
            </name>
            <authRecords>
                <add>
                    <WebAppAuthRecord>
                        <id>77355</id>
                    </WebAppAuthRecord>
                </add>
                <remove>
                    <WebAppAuthRecord>
                        <id>77356</id>
                    </WebAppAuthRecord>
                </remove>
            </authRecords>
        </WebApp>
    </data>
</ServiceRequest>

XML response

<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://qualysapi.qualys.com/qps/xsd/3.0/was/webapp.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <data>
        <WebApp>
            <id>1234</id>
        </WebApp>
    </data>
</ServiceResponse> 
      

Sample - Update multiple settingsSample - Update multiple settings

Let us update multiple settings for a web application. The web application is assigned custom settings as defined in the request POST data.

API request

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

Request POST data

<ServiceRequest>
    <data>
        <WebApp>
            <name>My Web Application</name>
            <url>http://mywebapp.com</url>
            <attributes>
                <remove>
                    <Attribute>
                        <name>Business Function</name>
                    </Attribute>
                    <Attribute>
                        <name>Business Location</name>
                    </Attribute>
                </remove>
                <update>
                    <Attribute>
                        <name>Business Description</name>
                        <value>Business Description Value - UPDATED</value>
                    </Attribute>
                </update>
            </attributes>
            <defaultProfile>
                <id>365333</id>
            </defaultProfile>
            <urlBlacklist>
                <set>
                    <UrlEntry>
                        <![CDATA[http://url.blacklist.1.mywebapp.com]]>
                    </UrlEntry>
                    <UrlEntry regex="false">
                        <![CDATA[http://url.blacklist.2.mywebapp.com]]>
                    </UrlEntry>
                    <UrlEntry regex="true">
                        <![CDATA[http://rg.blacklist.*.com]]>
                    </UrlEntry>
                </set>
            </urlBlacklist>
            <urlWhitelist>
                <set>
                    <UrlEntry>
                        <![CDATA[http://url.whitelist.1.mywebapp.com]]>
                    </UrlEntry>
                    <UrlEntry regex="false">
                        <![CDATA[http://url.whitelist.2.mywebapp.com]]>
                    </UrlEntry>
                    <UrlEntry regex="true">
                        <![CDATA[http://rg.whitelist.*.mywebapp.com]]>
                    </UrlEntry>
                </set>
            </urlWhitelist>
            <postDataBlacklist>
                <set>
                    <UrlEntry regex="true">
                        <![CDATA[http://url.postdatablacklist.1.mywebapp.com]]>
                    </UrlEntry>
                    <UrlEntry regex="true">
                        <![CDATA[http://url.postdatablacklist.2.mywebapp.com]]>
                    </UrlEntry>
                </set>
            </postDataBlacklist>
            <useRobots>ADD_PATHS</useRobots>
            <useSitemap>true</useSitemap>
            <headers>
                <set>
                    <WebAppHeader>X-TTP-REQUESTED-BY: Qualys Test</WebAppHeader>
                </set>
            </headers>
        </WebApp>
    </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/webapp.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <data>
        <WebApp>
            <id>2607056</id>
        </WebApp>
    </data>
</ServiceResponse>
      

Sample - Update web app to set default-cancel timeSample - Update web app to set default-cancel time

Let us set the default cancel scan option for web application ID 2392272. Scans of this web application will be set to cancel at 10pm by default.

API request

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

Request POST data

<ServiceRequest>
    <data>
        <WebApp>
            <name>
                <![CDATA[My Web App]]>
            </name>
            <url>
                <![CDATA[http://mywebapp.com]]>
            </url>
            <config>
                <cancelScansAt>22:00</cancelScansAt>
            </config>
        </WebApp>
    </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/webapp.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <data>
        <WebApp>
            <id>2392272</id>
        </WebApp>
    </data>
</ServiceResponse>
      

Update custom attribute value for the web appUpdate custom attribute value for the web app

API request

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

Request POST data

<ServiceRequest>
    <data>
        <WebApp>
            <attributes>
                <update>
                    <Attribute>
                        <name>Custom key 1</name>
                        <value>
                            <![CDATA[Custom value 1]]>
                        </value>
                    </Attribute>
                </update>
            </attributes>
        </WebApp>
    </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/webapp.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <data>
        <WebApp>
            <id>2514679</id>
        </WebApp>
    </data>
</ServiceResponse>

Sample - Update the default authentication record of the web appSample - Update the default authentication record of the web app

Let us update the default authentication record for the web application with ID 33831.

API request

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

Request POST data

<ServiceRequest>
    <data>
        <WebApp>
            <config>
                <defaultAuthRecord>
                    <id>9133</id>
                </defaultAuthRecord>
            </config>
        </WebApp>
    </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/webapp.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <data>
        <WebApp>
            <id>33831</id>
        </WebApp>
    </data>
</ServiceResponse>

XSD

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