Search Templates API

Use this API to search templates in the API user’s scope.

POST  /qps/rest/1.0/search/saq/template/

Permissions

The user must have the Security Assessment Questionnaire (SAQ) module enabled, and the User must have API ACCESS and Access SAQ module permission; output includes templates within the API user's scope.

Input ParameterInput Parameter

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

Parameter Optional/Mandatory Data Type Description Allowed Operators
id Optional Integer  Id of template EQUALS, IN
uuid Optional Integer UUID of template  EQUALS
name Optional Text Name of Template CONTAINS, EQUALS
description Optional Text Description of Template CONTAINS, EQUALS
category Optional Text Category of Template CONTAINS, EQUALS
familyId Optional Integer Family identifier of the template. EQUALS
revision Optional Integer Version of the template. EQUALS, IN
isLibrary Optional Boolean True if the template is created from a library template. EQUALS
questionCnt Optional Integer Count of questions in a template. EQUALS, IN
state Optional String State of the template (Published, Draft) EQUALS, IN

Sample - Search TemplatesSample - Search Templates

API Request

curl -u "USERNAME:PASSWORD" -H "content-type: text/xml" -X "POST" --data-binary @- "https:// <qualysbaseurl>/qps/rest/1.0/search/saq/template" < file.xml
Note: "file.xml" contains the request POST data. 

Request POST Data

<ServiceRequest>
      <filters>
        <Criteria field="questionCnt"
          operator="EQUALS">5</Criteria>
        <Criteria field="state" operator="EQUALS">DRAFT</Criteria>
        <Criteria field="name"
         operator="CONTAINS">scoring</Criteria>
      </filters>
</ServiceRequest> 

Response

<?xml version="1.0" encoding="UTF-8"?>
<ServiceResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://<qualysbaseurl>/qps/xsd/1.0/saq/template.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <hasMoreRecords>false</hasMoreRecords>
    <data>
        <Template>
            <id>82969</id>
            <uuid>5d9e0a22-14ff-4961-b0f0-a663c3b7f2f3</uuid>
            <name>template-from-api-with-scoring</name>
            <description>template containing scoring fields created from the api</description>
            <familyId>75120987-737d-4157-9b3f-d0c2229d8c1d</familyId>
            <revision>1</revision>
            <isLibrary>false</isLibrary>
            <questionCnt>5</questionCnt>
            <state>DRAFT</state>
            <elements>
                <sections>
                    <list>
                        <Section>
                            <name>section 1</name>
                            <description>section 1 description</description>
                            <sections/>
                            <questions>
                                <list>
                                    <Question>
                                        <label>0</label>
                                        <text>Question 0</text>
                                        <type>booleanQuestion</type>
                                        <mode>BUTTON</mode>
                                        <criticality>CRITICAL</criticality>
                                        <requireAttachment>false</requireAttachment>
                                        <requireComment>false</requireComment>
                                        <requireAsset>false</requireAsset>
                                        <yesScoringLabel>HIGH</yesScoringLabel>
                                        <noScoringLabel>MEDIUM</noScoringLabel>
                                    </Question>
                                    <Question>
                                        <label>1</label>
                                        <text>QUESTION 1</text>
                                        <type>booleanQuestion</type>
                                        <mode>BUTTON</mode>
                                        <criticality>CRITICAL</criticality>
                                        <requireAttachment>false</requireAttachment>
                                        <requireComment>false</requireComment>
                                        <requireAsset>false</requireAsset>
                                        <yesScoringLabel>HIGH</yesScoringLabel>
                                        <noScoringLabel>MEDIUM</noScoringLabel>
                                    </Question>
                                    <Question>
                                        <label>2</label>
                                        <text>QUESTION 2</text>
                                        <type>multipleChoiceQuestion</type>
                                        <mode>MULTI_SELECT</mode>
                                        <criticality>INFO</criticality>
                                        <requireAttachment>false</requireAttachment>
                                        <requireComment>false</requireComment>
                                        <requireAsset>false</requireAsset>
                                        <answers>
                                            <list>
                                                <Answer>
                                                    <title>choice 0</title>
                                                    <value>0</value>
                                                    <requireAttachment>false</requireAttachment>
                                                    <requireComment>false</requireComment>
                                                    <requireAsset>false</requireAsset>
                                                </Answer>
                                                <Answer>
                                                    <title>choice 1</title>
                                                    <value>1</value>
                                                    <scoringLabel>MEDIUM</scoringLabel>
                                                    <requireAttachment>false</requireAttachment>
                                                    <requireComment>false</requireComment>
                                                    <requireAsset>false</requireAsset>
                                                </Answer>
                                                <Answer>
                                                    <title>choice 2</title>
                                                    <value>2</value>
                                                    <scoringLabel>HIGH</scoringLabel>
                                                    <requireAttachment>false</requireAttachment>
                                                    <requireComment>false</requireComment>
                                                    <requireAsset>false</requireAsset>
                                                </Answer>
                                            </list>
                                        </answers>
                                    </Question>
                                </list>
                            </questions>
                        </Section>
                        <Section>
                            <name>section 2</name>
                            <description>section 2 description</description>
                            <sections/>
                            <questions>
                                <list>
                                    <Question>
                                        <label>3</label>
                                        <text>QUESTION 3</text>
                                        <type>multipleChoiceQuestion</type>
                                        <mode>MULTI_SELECT</mode>
                                        <criticality>INFO</criticality>
                                        <requireAttachment>false</requireAttachment>
                                        <requireComment>false</requireComment>
                                        <requireAsset>false</requireAsset>
                                        <answers>
                                            <list>
                                                <Answer>
                                                    <title>a</title>
                                                    <value>0</value>
                                                    <scoringLabel>LOW</scoringLabel>
                                                    <requireAttachment>false</requireAttachment>
                                                    <requireComment>false</requireComment>
                                                    <requireAsset>false</requireAsset>
                                                </Answer>
                                                <Answer>
                                                    <title>b</title>
                                                    <value>1</value>
                                                    <scoringLabel>MEDIUM</scoringLabel>
                                                    <requireAttachment>false</requireAttachment>
                                                    <requireComment>false</requireComment>
                                                    <requireAsset>false</requireAsset>
                                                </Answer>
                                                <Answer>
                                                    <title>c</title>
                                                    <value>2</value>
                                                    <scoringLabel>HIGH</scoringLabel>
                                                    <requireAttachment>false</requireAttachment>
                                                    <requireComment>false</requireComment>
                                                    <requireAsset>false</requireAsset>
                                                </Answer>
                                            </list>
                                        </answers>
                                    </Question>
                                </list>
                            </questions>
                        </Section>
                    </list>
                </sections>
                <questions>
                    <list>
                        <Question>
                            <label>4</label>
                            <text>QUESTION 4</text>
                            <type>booleanQuestion</type>
                            <mode>BUTTON</mode>
                            <criticality>INFO</criticality>
                            <requireAttachment>false</requireAttachment>
                            <requireComment>false</requireComment>
                            <requireAsset>false</requireAsset>
                            <yesScoringLabel>MEDIUM</yesScoringLabel>
                            <noScoringLabel>LOW</noScoringLabel>
                        </Question>
                    </list>
                </questions>
            </elements>
            <scorings>
                <list>
                    <Scoring>
                        <label>LOW</label>
                        <value>0</value>
                    </Scoring>
                    <Scoring>
                        <label>MEDIUM</label>
                        <value>50</value>
                    </Scoring>
                    <Scoring>
                        <label>HIGH</label>
                        <value>100</value>
                    </Scoring>
                </list>
            </scorings>
        </Template>
    </data>
</ServiceResponse> 

XSDXSD

<platform API server>/qps/xsd/1.0/saq/template.xsd