Update Activation Key

[POST] /qps/rest/1.0/update/ca/agentactkey/<id>

Update an activation key in the user’s account.

Where “id” (Required) is the ID of the activation key to be updated. 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 “Edit Activation Key”.

Input ParametersInput Parameters

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

Supported filter operators

Parameter

Mandatory

/Optional

Data Type

Description

id 

Mandatory

integer

ID of activation key to be updated.

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, EDR, FIM, SWCA, CAPS, MTG.

tags 

Optional

string

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

isDisabled 

Optional

boolean

Set to true to disable or false to keep active.

applyOnAgents 

Optional

boolean

Set to true to apply changes in the update request to all existing agents. Changes include tags, licenses and limits. By default set to false and changes are not applied to all existing agents.

Sample - Update activation keySample - Update activation key

API request

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

Contents of key_update.xml

<?xml version="1.0" encoding="UTF-8"?>
<ServiceRequest>
    <data>
        <AgentActKey>
            <id>6201</id>
            <title>example key updated from api</title>
            <countPurchased>0</countPurchased>
            <expireDate>2016-12-05T23:05:42Z</expireDate>
            <type>UNLIMITED</type>
            <ownerId>364812443</ownerId>
            <applyOnAgents>true</applyOnAgents>
            <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>      
    

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>6201</id>
            <title>example key updated from api</title>
            <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>
            <applyOnAgents>true</applyOnAgents>
            <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>
            <ownerId>364812443</ownerId>
        </AgentActKey>
    </data>
</ServiceResponse>      
    

XSD

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