Create Activation Key

[POST] /qps/rest/1.0/create/ca/agentactkey/

You can create an activation key using this API. While creating an activation key, you can define which all modules you want to activate for your Cloud Agent, key type, key expiry date, and so on. We have added support for new Qualys application — Mitigation. 

Permissions required - Managers with full scope. Other users must have these permissions: Access Permission “API Access” and CA Activation Key Permission “Create Activation Key”.

Input ParametersInput Parameters

These <ServiceRequest> parameters are used to create an activation key. Filter operators are available for use with <ServiceRequest> parameters.

Supported filter operators

Parameter

Mandatory

/Optional

Data Type

Description

type 

Mandatory

string

Key type. Valid is one of: UNLIMITED, COUNT_LIMITED, TIME_LIMITED, COUNT_TIME_LIMITED

countPurchased

Mandatory

integer

(required if type is COUNT_LIMITED or COUNT_TIME_LIMITED) Number of keys purchased. Value is 1 or more.

expireDate 

Mandatory

date

(required if type is TIME_LIMITED or COUNT_TIME_LIMITED) Key expiration date. Date is specified in UTC/GMT format, i.e. YYYY-MM-DD[THH:MM:SSZ

modules 

Optional

string

Provision one or more modules for this key. Value is one of:  VM_LICENSE, PC_LICENSE, SCA, PM, SA, FIM, EDR, SWCA, CAPS, MTG.

tags 

Optional

string

Add tags to this key. These tags will be added to agents installed with key.

Sample - Create activation keySample - Create activation key

API request

curl -X POST -H "Content-Type: text/xml" -H "X-Requested-With: curl" -H "Authorization: Basic AbcdAbcdAbcdAbcdAbcd" -H "Cxml" -H "Cache-Control: no-cache" --data-binary @key_create.xml "<qualys_base_url>/qps/rest/1.0/create/ca/agentactkey/"
Note: “key_create.xml” contains the request POST data.      
    

Contents of key_create.xml

<?xml version="1.0" encoding="UTF-8"?>
<ServiceRequest>
    <data>
        <AgentActKey>
            <title>example create from api</title>
            <countPurchased>0</countPurchased>
            <expireDate>2016-12-05T23:05:42Z</expireDate>
            <type>UNLIMITED</type>
            <ownerId>364812443</ownerId>
            <modules>
                <list>
                    <ActivationKeyModule>
                        <license>VM_LICENSE</license>
                    </ActivationKeyModule>
                    <ActivationKeyModule>
                        <license>PC_LICENSE</license>
                    </ActivationKeyModule>
                    <ActivationKeyModule>
                        <license>SCA</license>
                    </ActivationKeyModule>
                    <ActivationKeyModule>
                        <license>PM</license>
                    </ActivationKeyModule>
                    <ActivationKeyModule>
                        <license>SA</license>
                    </ActivationKeyModule>
                    <ActivationKeyModule>
                        <license>FIM</license>
                    </ActivationKeyModule>
                    <ActivationKeyModule>
                        <license>EDR</license>
                    </ActivationKeyModule>
                    <ActivationKeyModule>
                        <license>SWCA</license>
                    </ActivationKeyModule>
                    <ActivationKeyModule>
                        <license>CAPS</license>
                    </ActivationKeyModule>
                    <ActivationKeyModule>
                         <license>MTG</license> 
                    </ActivationKeyModule>
                </list>
            </modules>
            <tags>
                <list>
                    <Tag>
                        <id>522325</id>
                        <name>Temp Tag</name>
                    </Tag>
                </list>
            </tags>
        </AgentActKey>
    </data>
</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/1.0/ca/agentactkey.xsd">
    <responseCode>SUCCESS</responseCode>
    <count>1</count>
    <data>
        <AgentActKey>
            <id>59001</id>
            <activationKey>548ec9eb-9ee4-45d9-aa2f-f3083983bf3c</activationKey>
            <status>ACTIVE</status>
            <countPurchased>0</countPurchased>
            <countUsed>0</countUsed>
            <datePurchased>2016-09-07T14:48:15Z</datePurchased>
            <type>UNLIMITED</type>
            <title>example key create from api</title>
            <isDisabled>false</isDisabled>
            <modules>
                <list>
                    <ActivationKeyModule>
                        <license>VM_LICENSE</license>
                    </ActivationKeyModule>
                    <ActivationKeyModule>
                        <license>PC_LICENSE</license>
                    </ActivationKeyModule>
                    <ActivationKeyModule>
                        <license>SCA</license>
                    </ActivationKeyModule>
                    <ActivationKeyModule>
                        <license>PM</license>
                    </ActivationKeyModule>
                    <ActivationKeyModule>
                        <license>SA</license>
                    </ActivationKeyModule>
                    <ActivationKeyModule>
                        <license>FIM</license>
                    </ActivationKeyModule>
                    <ActivationKeyModule>
                        <license>EDR</license>
                    </ActivationKeyModule>
                    <ActivationKeyModule>
                        <license>SWCA</license>
                    </ActivationKeyModule>
                    <ActivationKeyModule>
                        <license>CAPS</license>
                    </ActivationKeyModule>
                    <ActivationKeyModule>
                         <license>CAPS</license> 
                    </ActivationKeyModule> 
                </list>
            </modules>
            <tags>
                <list>
                    <Tag>
                        <id>522325</id>
                        <name>Temp Tag</name>
                    </Tag>
                </list>
            </tags>
            <ownerId>364812443</ownerId>
        </AgentActKey>
    </data>
</ServiceResponse>      
    

XSD

<platform API server>/qps/xsd/1.0/ca/agentactkey.xsd