You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 62 Next »

The Denials endpoint delivers license usage metrics specific to Denials, allowing you to see exactly how many license checkout requests were denied and how often the denials took place.

Obtaining information about checkout denials

You can easily list the username and hostname for each denial that took place by sending the following HTTP request.

GET /api/v1/report/feature/${featureId}/denials/${returnType}?sd=${startDate}&ed=${endDate}&(additional parameters, as needed) 

where $ indicates a variable value that you can replace with a value that best suits your needs. The possible parameters are described below.

ParameterRequiredTypeDescription
${featureId}Yesinteger

Specifies ID of the feature for which you want to view denied requests.

${returnType}YesstringSpecifies the format in which the data should be returned. The format can be one of the following: json, csv, xlsx, or pdf.
sdYesstringSpecifies the starting date from which you want to generate the report. The date is in YYYY-MM-DD format; for example, 2017-05-20.
ed

Yes

stringSpecifies the end date from which you want to generate the report. The date is in YYYY-MM-DD format; for example, 2017-05-20. The date is inclusive, meaning that all data from a particular day will be included in the report.
fieldsVisibility Nojson/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.
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 XLSX. 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 XLSX types. If provided, it cannot be left empty.
filterNojson/string

Applies filtering license usage data on all fields.

To filter by a string column, use the following format.

[
	{ 
		"type": "string",
		"field": "${un | hn | ldt}",
		"value": "${value}"
	}
]
To filter by a numeric column, use the following format. 
[
	{ 
		"type": "numeric", 
		"comparison": "${gt | lt | eq}", 
		"field": "ldtc",
		"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:

un, hn, ldt, ldt

(See this section for more field-specific information.)

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

Response

The following code block shows an example result of a successful request.

  {
      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:

FieldTypeDescription

un

string

Username.

hn

string

Hostname.

ldt

string

 Date on which the denial took place in YYYY-MM-DD format.

ldtc

string

Total number of denied license checkout requests.

msg

string

Error message returned on failure.

success

boolean

Indicates whether your API request was successfully processed. 

codeinteger

Error code for unsuccessful request.

totalCountinteger

Total number of all matching results.


Example 1

The following example shows a command that lets you obtain information about denials for feature "3" over a given time period.

curl --data "sd=2015-01-01" --data "ed=2015-01-02" -H "X-Auth-token: token" "http://yourdomain/api/v1/report/feature/3/denials/json"

Example 2

The following example shows a command that lets you obtain information about all denials for feature "3" over a specific time period, with data ordered by username.

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/feature/3/denials/json"

Example 3

The following example shows a command that lets you view the first 100 denials for feature "3" over a given time period.

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/feature/3/denials/json"

You can also put parameters directly into the URL; for the above example, the command would be similar to the following.

curl -H "X-Auth-token: token" "http://yourdomain/api/v1/report/feature/3/denials/json?limit=100&offset=0&sd=2014-12-01&ed=2015-01-02"

Obtaining information about grouped checkout denials

You can easily list denials for username and hostname by sending the following HTTP request.

GET /api/v1/report/feature/${featureId}/denials/grouped/${returnType}?sd=${startDate}&ed=${endDate}&grat=${granularity}&(additional parameters, as needed) 

where $ indicates a variable value that you can replace with a value that best suits your needs. The possible parameters are described below.

ParameterRequiredTypeDescription
${featureId}Yesinteger

Specifies ID of the feature for which you want to view grouped checkout denials.

${returnType}YesstringSpecifies format in which the data should be returned. The format can be one of the following: json, csv, xlsx, or pdf.
sdYesstring

Specifies starting date from which you want to generate the report. The date is in YYYY-MM-DD format; for example, 2017-05-20.

ed

Yes

stringSpecifies end date from which you want to generate the report. The date is in YYYY-MM-DD format; for example, 2017-05-20. The date is inclusive, meaning that all data from a particular day will be included in the report.
gratYesstring

Specifies granularity of the returned data, which can be one of the following:

  • QUARTER or 2
  • MONTH or 3
  • WEEK or 4
  • DAY or 5
  • HOUR or 6
fieldsVisibility Nojson/string

Specifies field visibility settings, for example:

{"ldt": "1", "ldtc":"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 XLSX. 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 XLSX types. If provided, it cannot be left empty.
filterNojson/string

Applies filtering license usage data on all fields.

To filter by a string column, use the following format: 

[
	{ 
		"type": "string",
		"field": "ldt",
		"value": "${value}"
	}
]

To filter by a numeric column, use the following format: 
[
	{ 
		"type": "numeric", 
		"comparison": "${gt | lt | eq}", 
		"field": "ldtc",
		"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:

un, hn, ldt, ldt

(See this section for more field-specific information.)

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

Response

The following code block shows an example result of a successful request.

  {
      success: ${success},
      msg: ${message},
      data: [{
        "ldt": ${licenseDenialTime},
        "ldtc": ${licenseDenialTotalCount}
      }]
  }

where the response fields can be explained as follows:

FieldTypeDescription

ldt

string

Indicates period of time for which usage information is generated, i.e. date and time for hourly usage and dates for the remaining granularity options.

ldtc

string

Total number of denied license checkout requests.

msg

string

Error message returned on failure.

success

boolean

Indicates if the API request was successfully processed.

msg

string

Error message returned on failure.

codeinteger

Error code for unsuccessful request.

totalCountintegerTotal number of denied license checkout requests.


Example 1

The following example shows a command that obtains information about denials for feature "3" grouped by month.

curl --data "sd=2015-01-01" --data "ed=2015-01-02" --data "grat=3" -H "X-Auth-token: token" "http://yourdomain/api/v1/report/feature/3/denials/grouped/json"

Example 2

The following example shows a command that lets you see all denials grouped by quarter for feature "3" ordered by the total denial count from highest to lowest.

curl --data "orderBy=ldtc" --data "orderDirection=DESC" --data "sd=2014-01-01" --data "ed=2015-01-01" --data "grat=2" -H "X-Auth-token: token" "http://yourdomain/api/v1/report/feature/3/denials/grouped/json"

Example 3

The following example shows a command that lets you view the first 100 denials for feature "3" over a specific time period, grouped by hour. 

curl --data "limit=100" --data "offset=0" --data "sd=2013-01-01" --data "ed=2015-01-02" --data "grat=6" -H "X-Auth-token: token" "http://yourdomain/api/v1/report/feature/3/denials/grouped/json"

You can also put parameters directly into the URL; for the above example, the command would look like the following:

curl -H "X-Auth-token: token" "http://yourdomain/api/v1/report/feature/3/denials/grouped/json?limit=5&offset=2&sd=2013-01-01&ed=2015-01-02&grat=6"
  • No labels