Some information on this page refers to License Statistics v5.4 or newer, which introduced a versioned endpoint URL path in order to maintain version integrity into the future. |
License Statistics API lets you generate data from the Denials report. This report shows how many license checkout requests were denied and how often the denials took place.
Obtaining information about checkout denials
If you want to retrieve information about denials for username and hostname, we recommend that you use the following URL request template.
GET /api/v1/report/denials/${featureId}/${returnType}?sd=${startDate}&ed=${endDate}&(additional parameters, as needed)
where:
- $ indicates a variable value that you can replace with an appropriate value, as needed
- possible parameters are as follows:
Parameter | Required | Type | Description |
---|---|---|---|
${featureId} | Yes | integer | Specifies feature-specific parameters. |
${returnType} | Yes | string | Specifies the format in which license usage data should be returned. The format can be one of the following: json, csv, xls or pdf. |
sd | Yes | string | Specifies starting date from which you want to generate the report. The date and time format is as follows: YYYY-MM-DD, for example, 2015-01-20. |
ed | Yes | string | Specifies end date from which you want to generate the report. Date format as above. Date is inclusive, meaning all data from the particular day will be included in the report. |
fieldsVisibility | No | json/string | Specifies field visibility settings, for example: {"un": "1", "hn": "1", "ldt": "1", "ldtc":"1"} where number "1" indicates that a specific field is visible. |
rn | No | string | Specifies 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. |
filter | No | json/string | Applies filtering license usage data on all fields. To filter by string column, use the following format: [ { "type": "string", "field": "${un | hn | ldt}", "value": "${value}" } ] To filter by numeric column, use the following format: [ { "type": "numeric", "comparison": "${gt | lt | eq}", "field": "ldtc", "value": "${value}" } ] |
limit | No | integer | Determines the maximum number of data records that can be returned. The value must be greater than zero. |
offset | No | integer | Specifies the offset of the first row to return. |
orderBy | No | string | Specifies the field by which you want to order your data records. The field name can be one of the following: un, hn, ldt, ldtc. |
orderDirection | No | string | Determines whether the sorting results will be displayed in ascending (ASC) or descending (DESC) order. |
If your request is successful, you should see a response similar to the following:
{ success: ${success}, msg: ${message}, data: [{ "un": ${userName}, "hn": ${hostName}, "ldt": ${licenseDenialTime}, "ldtc": ${licenseDenialTotalCount} }], "code": ${errorCode}, "totalCount": ${totalCount} }
where the response fields can be explained as follows:
Field | Type | Description |
---|---|---|
un | string | Username. |
hn | string | Hostname. |
ldt | string | License Denial Time in YYYY-MM-DD format |
ldtc | string | License Denial Total Count |
msg | string | Error message returned on failure. |
success | boolean | Indicates if the API request was successfully processed. |
code | integer | Error code if success == false |
totalCount | integer | Count of all matching results. |
Example 1
For example, say you would like to view denials for feature 3 over some period of time. To generate such data, enter a command that is similar to the following:
curl --data "sd=2015-01-01" --data "ed=2015-01-02" -H "X-Auth-token: token" "http://yourdomain/api/v1/report/denials/3/json"
Example 2
Let's assume you want to see all denials for feature 3 ordered by username over a specific period of time. To do this, enter a command similar to the following:
curl --data "orderBy=un" --data "orderDirection=ASC" --data "sd=2015-01-01" --data "ed=2015-01-02" -H "X-Auth-token: token" "http://yourdomain/api/v1/report/denials/3/json"
Example 3
Let's assume you're interested in viewing the first 100 denials for feature 3 over a specific period of time. To do this, enter a command that is similar to the following:
curl --data "limit=100" --data "offset=0" --data "sd=2015-01-01" --data "ed=2015-01-02" -H "X-Auth-token: token" "http://yourdomain/api/v1/report/denials/3/json"
Obtaining information about grouped checkout denials
If you want to retrieve information about denials for username and hostname, we recommend that you use the following URL request template.
GET /api/v1/report/denials/grouped/${featureId}/${returnType}?sd=${startDate}&ed=${endDate}&(additional parameters, as needed)
where:
- $ indicates a variable value that you can replace with an appropriate value, as needed
- possible parameters are as follows:
Parameter | Required | Type | Description |
---|---|---|---|
${featureId} | Yes | integer | Specifies feature-specific parameters. |
${returnType} | Yes | string | Specifies the format in which license usage data should be returned. The format can be one of the following: json, csv, xls or pdf. |
sd | Yes | string | Specifies starting date from which you want to generate the report. The date and time format is as follows: YYYY-MM-DD, for example, 2015-01-20. |
ed | Yes | string | Specifies end date from which you want to generate the report. Date format as above. Date is inclusive, meaning all data from the particular day will be included in the report. |
granularity | Yes | integer | Specifies granularity of the returned data, which can be one of the following:
|
fieldsVisibility | No | json/string | Specifies field visibility settings, for example: {"ldt": "1", "ldtc":"1"} where number "1" indicates that a specific field is visible. |
rn | No | string | Specifies 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. |
filter | No | json/string | Applies filtering license usage data on all fields. To filter by string column, use the following format: [ { "type": "string", "field": "ldt", "value": "${value}" } ] To filter by numeric column, use the following format: [ { "type": "numeric", "comparison": "${gt | lt | eq}", "field": "ldtc", "value": "${value}" } ] |
limit | No | integer | Determines the maximum number of data records that can be returned. The value must be greater than zero. |
offset | No | integer | Specifies the offset of the first row to return. |
orderBy | No | string | Specifies the field by which you want to order your data records. The field name can be one of the following: un, hn, ldt, ldtc. |
orderDirection | No | string | Determines whether the sorting results will be displayed in ascending (ASC) or descending (DESC) order. |
If your request is successful, you should see a response similar to the following:
{ success: ${success}, msg: ${message}, data: [{ "ldt": ${licenseDenialTime}, "ldtc": ${licenseDenialTotalCount} }] }
where the response fields can be explained as follows:
Field | Type | Description |
---|---|---|
ldt | string | License Denial Time in YYYY-MM-DD format |
ldtc | string | License Denial Total Count |
msg | string | Error message returned on failure. |
success | boolean | Indicates if the API request was successfully processed. |
msg | string | Error message returned on failure. |
code | integer | Error code if success == false |
totalCount | integer | Count of all matching results. |