Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

License Statistics API allows you to obtain information about Current Users report. The report consists of three parts: current license usage, highest license usage and current users list.

Obtaining information about current users

To list users that are currently using licenses, use following URL template

...

- the possible parameters are as follows:

1
Parameter
Required
Type
Description
${returnType}YesstringSpecifies the format in which the data should be returned. The format can be one of the following: json, csv, xls or pdf.
fieldsVisibility Nojson/string

Specifies field visibility settings, for example:

 

Code Block
{ "fid": "1", "fns": "1", "fv": "1", "ftype": "1", "lsid": "1", "lsn": "1", "uid": "1", "un": "1", "hn": "1",  "lco": "1","fu": "1"}

where number "1" indicates that a specific field is visible.

Note that the order of the settings you make is important – when exported, the fields will be visible in exactly the same order you specify here.

rnNostringSpecifies the name of the report that will be displayed once the report has been exported to PDF or XLS. For CSV and JSON formats this parameter will be ignored.
If you don't pass this parameter, it will be generated automatically for PDF and XLS types. If provided, it cannot be left empty.
filterNojson/string

Applies filtering license usage data on all fields.

To filter by string column, use the following format:

 

 

Code Block
[
    {
        "type": "string",
        "field": ""${un | hn | fns | fv | ftype | lsn | lco}",
        "value": "${value}"
    }
]

To filter by numeric column, use the following format: 

Code Block
[
    {
        "type": "numeric",
        "comparison": "${gt | lt | eq}",
        "field": "${fid | lsid | uid | fu }",
        "value": "${value}"
    }
]


limitNointegerDetermines the maximum number of data records that can be returned. The value must be greater than zero.
offsetNointegerSpecifies the offset of the first row to return.
orderByNostring

Specifies the field by which you want to order your data records. The field name can be one of the following: fid, fns, fv, ftype, lsid, lsn, uid, un, hn, lco, fu.

orderDirectionNostringDetermines whether the sorting results will be displayed in an ascending (ASC) or a descending (DESC) order.

If your request is successful, you should see a response similar to the following: 

 

Code Block
languagejs
firstline1
linenumberstrue
{
    success: ${success},
    msg: ${message},
    data: [{
        "fid": ${featureId},
        "fns": ${featureName},
        "ftype": ${featureType},
        "fv": ${featureVersion},
        "lsid": ${licenseServerId},
        "lsn": ${licenseServerName},
        "uid": ${userId},
        "un": ${userName},
        "hn": ${hostName},
        "lco": ${licenseCheckedOut},
        "fu": ${licensesUsed}
    }],
    "code": ${errorCode},
    "totalCount": ${totalCount}
}

where the response fields can be explained as follows:

Field
Type
Description
fidintegerFeature ID.
fnsstringFeature Name.
ftypestringFeature type.
fvstringFeature version.
lsidintegerLicense Server ID.
lsnstringLicense Server name.
uidintegerUser ID.

un

string

Username.

hn

string

Hostname.

lco

string

Date when license was checked out, in 'YYYY-MM-DD HH:MM:SS' format.

fu

integer

Total number of licenses used by user on host.

msg

string

Error message returned on failure.

success

boolean

Indicates whether the API request was successfully processed. 

codeinteger

Error code for unsuccessful request.

totalCountinteger

Total number of all matching results.

Obtaining information about current license usage

To obtain information about how many users are using licenses at the moment, use following URL

...

where the response fields can be explained as follows:

Field
Type
Description
successbooleanIndicates that your API request was successfully processed.
msgstringError message returned on failure.
hustring"1" in record with usage. "0" for record without usage.
tuintegerNumber of users with/without usage.
codeinteger

Error code if success equals false, null otherwise.

totalCountintegerTotal number of rows returned. Always 2.

Example

Say you have many license server. Among them several LM-X servers called 'lm-x 1', 'lm-x 2', and so on. To find out how many users are using licenses (only) from those servers, use:

Code Block
languagejs
firstline1
linenumberstrue
curl --globoff -H "X-Auth-token: token" 'http://yourdomain/api/v1/report/users/license/current-usage/json?filter=[{"type":"string","field":"lsn","value":"lm-x"}]'

Obtaining information about highest license usage

To get to know 10 users that used most licenses in last 13 days, use following URL

...

where the response fields can be explained as follows:

Field
Type
Description
successbooleanIndicates that your API request was successfully processed.
msgstringError message returned on failure.
unstringUsername.
fuintegerNumber fo licenses used.
codeinteger

Error code if success equals false, null otherwise.

totalCountintegerTotal number of rows returned. Always 10.

Example

Say you have feature 'super_feature'. To find out which users use this feature (in any version) the most, use:

...