Currently, the License Statistics API lets you generate data from the User history report. This report shows statistics for license usage per user, during any period that usage was tracked.
Showing sessions at a specific point in time
If you want to retrieve information about usage history at a particular point in time, we recommend that you use the following Url or URL?? request template.
GET /report/user-history/${featureId}/${returnType}?sdt=${sessionDateTime}
where:
- $ indicates a variable value that you can replace with an appropriate value, as needed
- the possible parameters are as follows:
Parameter | Required | Type | Description |
---|---|---|---|
${featureId} | Yes | integer | You can find more feature-related information here. Dunno why we have to redirect them to that table on End-user API. Cannot we provide a brief definition here? |
${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. |
sdt | Yes | string | Specifies the format in which the date and time are returned. The format is yyyy-MM-dd HH:mm; for example, 2015-01-20 11:00. (why not YYY-MM-DD HH: MM–all capital letters??)? Just verify if this is OK please. |
fieldsVisibility-I feel like changing this to "fieldVisibility" Can we do this? | No | json/string | Specifies field visibility settings, for example: {"un": "1", "hn": "1", "sst": "1", "set": "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, CSV, or Excel. |
filter | No | json/string | Applies filtering license usage data on all fields. To filter your data, use the following format: [{"value": intOrString, "field": "${fid | fns | fv | ftype | lsid | lsn | vn | gtn}"}] |
limit | No | integer | Specifies the maximum ?? number of 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 column by which you want to order your data records. The column name can be one of the following: uid, un, hn, sst, set. tu chyba jednak trzumamy si? termonologii field zamiast column nie? |
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: true, message: ${message}, data: [{ uid: ${userId}, un: ${userName}, hn: ${hostName}, sst: ${sessionStartTime}, set: ${sessionEndTime}, il: ${hasUserLdapDetails} }] }
where the response fields can be explained as follows:
Field | Type | Description |
---|---|---|
uid | integer | User Id. |
un | string | Username. |
hn | string | Hostname. |
sst | string | The date returned in yyy-MM-dd HH:mm format. |
set | string | The date returned in yyy-MM-dd HH:mm format, "Unknown", or "Still in use". |
il | boolean | This field/column indicates whether user details have been imported from LDAP directory. Note that currently you cannot filter and order data by this field. |
message | string | Unlimited string. |
Example 1
Say you would like to view all sessions for feature 3 at a specific time point. To do this, enter a command that is similar to the following:
curl --data-urlencode "sdt=2015-10-30 00:00" -H "X-Auth-token: abcd" "http://youdomain/report/user-history/3/json"
Example 2
Let's assume you would like to see all sessions for feature 3 ordered by username at a specific time point. To view such data, enter a command similar to the following:
curl --data "orderBy=un" --data-urlencode "sdt=2015-10-30 00:00" -H "X-Auth-token: abcd" "http://yourdomain/report/user-history/3/json"
Example 3
Say you need to view the first 100 sessions for feature 3 at a specific time point. You need to enter a command similar to the following:
curl --data "limit=100" --data "offset=0" --data-urlencode "sdt=2015-10-30 00:00" -H "X-Auth-token: abcd" "http://yourdomain/report/user-history/3/json"
Showing sessions over a specific time period
Response fields can be explained as follows: