Search Tags

[POST] /qps/rest/2.0/search/am/tag

Returns a list of tags that match the provided criteria.

Pagination - A maximum of 100 tags are returned by default. To customize this specify a “preferences” tag in the POST body of your request.

Limit your results - Use the optional “fields” parameter to limit the amount of information returned for the tag. Learn more



Permissions required - Managers with full scope, other users must have Access Permission “API Access”

Input ParametersInput Parameters

Click here for available operators

Parameter

Mandatory

/Optional

Data Type

Description

id 

  integer

 

name 

 

text

 

parent 

 

integer

 

ruleType

   

GROOVY, OS_REGEX, NETWORK_RANGE, NAME_CONTAINS, INSTALLED_SOFTWARE, OPEN_PORTS, VULN_EXIST, ASSET_SEARCH, CLOUD_ASSET, BUSINESS_INFORMATION

provider

   

EC2, AZURE, GCP, IBM, OCI, Alibaba

color

   

Text formatted as #FFFFFF where F can be any value between 0-9 and A-F

Sample 1 - Find tags with groovy script rulesSample 1 - Find tags with groovy script rules

API request

curl -u "USERNAME:PASSWORD" -H "content-type: text/xml" -X "POST" --data-binary @- "<qualys_base_url>/qps/rest/2.0/search/am/tag" < file.xml
Note: “file.xml” contains the request POST data.      
    

Request POST data

<ServiceRequest>
    <filters>
        <Criteria field="ruleType" operator="EQUALS">GROOVY</Criteria>
    </filters>
</ServiceRequest>      
    

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/2.0/am/tag.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>2</count>
    <hasMoreRecords>true</hasMoreRecords>
    <lastId>10449935</lastId>
    <data>
        <Tag>
            <id>12345</id>
            <name>Tag</name>
            <created>2014-02-06T19:14:50Z</created>
            <modified>2014-02-06T19:14:50Z</modified>
            <color>#FF0000</color>
            <ruleText>asset.installedSoftwares.contains { it.name == "Windows" }</ruleText>
            <ruleType>GROOVY</ruleType>
            <children>
                <list>
                    <SimpleTag>
                        <id>123</id>
                        <name>Red</name>
                    </SimpleTag>
                    <list>
                    </children>
                </Tag>
                <Tag>
                    <id>12346</id>
                    <name>Another Red Tag</name>
                    <created>2014-02-06T19:14:50Z</created>
                    <modified>2014-02-06T19:14:50Z</modified>
                    <color>#FF0000</color>
                    <ruleText>asset.installedSoftwares.contains { it.name == "Windows" }</ruleText>
                    <ruleType>GROOVY</ruleType>
                    <children>
                        <list>
                            <SimpleTag>
                                <id>123</id>
                                <name>Red</name>
                            </SimpleTag>
                            <list>
                            </children>
                        </Tag>
                    </data>
                </ServiceResponse>
                <responseCode>SUCCESS</responseCode>      
    

Sample 2 - Search an asset tag with criticality scoreSample 2 - Search an asset tag with criticality score

API request

curl -n -u "USERNAME:PASSWORD" -H "content-type: text/xml"-X "POST" --
"<qualys_base_url>/rest/2.0/search/am/tag" < file.xml
Note: “file.xml” contains the request POST data.      
    

Request POST data

<ServiceRequest>
    <filters>
        <Criteria field="criticalityScore"
         operator="EQUALS">
        3</Criteria>
    </filters>
</ServiceRequest>      
    

Response

<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="<qualys_base_url>/qps/rest/2.0/search/am/tag">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <hasMoreRecords>false</hasMoreRecords>
    <data>
        <Tag>
            <id>7824612</id>
            <name>critical_3</name>
            <created>2021-06-08T13:09:00Z</created>
            <modified>2021-06-08T13:09:00Z</modified>
            <color>#FFFFFF</color>
            <criticalityScore>3</criticalityScore>
        </Tag>
    </data>
</ServiceResponse>      
    

XSD

<platform API server>/qps/xsd/2.0/am/tag.xsd