Updating and Inserting New Keys in the Key Registry

This request is used in order to update existing keys or to insert new keys into the key registry. Keys can be updated one by one or in batch. A single batch can contain both new and existing keys to be inserted or updated accordingly.

Request/Response Parameters Summary
Example Request
Example Response

Request/Response Parameters Summary

POST /licenseKeys/updateKeys

Request JSON Object

The following is a summary of the properties inside the response JSON object.

Request Properties

Property

Description

user (string)

The username of your Usage Intelligence user account.

sessionId (string)

The sessionId obtained via POST /auth/login.

productId (integer)

The product ID on which this request is being done

keyUpdates (array)

Array containing a number of JSON objects each containing a license key and the fields to be updated. The license key is the only compulsory value. All the rest are optional as you may send a subset of the fields. If a license key is already present in the key registry, the values that are not sent in this object are left untouched in the key registry. If the key is not present and an insert is taking place, default values are applied to the missing fields. The object members are as follows:

licenseKey (string)

The license key to be updated or inserted to the key registry. This value is compulsory.

licenseType (string)

The license type such as purchased, freeware, etc.. Default is unknown.

licenseStatus (object)

A JSON object containing the 4 license status flags or a subset:

activated (boolean)—Whether the key is to be set as activated. Default is false.
blacklisted (boolean)—Whether the key is to be set as blacklisted. Default is false.
expired (boolean)—Whether the key is to be set as expired. Default is false.
whitelisted (boolean)—Whether the key is to be set as whitelisted. Default is false.

expiryDate (string/null)

The date the key is set to expire formatted as YYYY-MM-DD. A null value may also be sent to set this field as *null. Default is null.

installQuota (integer)

The maximum number of installations allowed to use this key. Default is *1.

notes (string)

A string value used to store reference notes about this key. Default is a zero-length (empty) string.

Example Request

POST /licenseKeys/updateKeys  HTTP/1.1

Host: api.revulytics.com

Content-Type: application/json

Accept: application/json

 

{

    "user": "testuser@test.com",

    "sessionId": "VSB8E2BzSC2eZSJm4QmTpA",

    "productId": 12345678901,

    "keyUpdates": [

        {

            "licenseKey": "70cda86c-46c3-4399-b358-9e762ed1fcf5",

            "licenseType": "purchased"

        },

        {

            "licenseKey": "14e7821b-694d-4d2d-90c2-adb10c07df0c",

            "licenseStatus": {

                "whitelisted": true,

                "activated": true,

                "expired": false

            },

            "expiryDate": "2017-10-31"

        }

    ]

}

Example Response

HTTP/1.1 200 OK

Content-Type: application/json

{

  "status": "OK",

  "insertedKeys": 0,

  "rejectedKeys": 0,

  "updatedKeys": 2

}