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

Compare with Current View Page History

« Previous Version 10 Next »

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 request template.

GET /api/report/user-history/${featureId}/${returnType}?sdt=${sessionDateTime}&(additional parameters, as needed)

where:

- $ indicates a variable value that you can replace with an appropriate value, as needed

- the possible parameters are as follows:

ParameterRequiredTypeDescription
${featureId}Yesinteger

Specifies feature-specific parameters.

${returnType}YesstringSpecifies the format in which license usage data should be returned. The format can be one of the following: json, csv, xls or pdf.
sdtYesstringSpecifies point in time for which you want to generate the report. The date and time format is as follows: YYYY-MM-DD HH:MM; for example, 2015-01-20 11:00.
fieldsVisibility Nojson/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.
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 Excel.
filterNojson/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}"}]
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: uid, un, hn, sst, set.

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

FieldTypeDescription
uidintegerUser Id.
unstringUsername.
hnstringHostname.
sststringDate returned in YYYY-MM-DD HH:MM format; for example, 2016-01-20 11:00.
setstringDate returned in YYYY-MM-DD HH:MM format (for example, 2016-01-20 11:00), "Unknown", or "Still in use".
ilbooleanThis field indicates whether user details have been imported from LDAP directory. Note that you cannot filter and order data by this field.
messagestringError message returned on failure.
successbooleanThis field indicates that the API request was successfully processed.


Example 1

For example, say you would like to view all sessions for feature 3 at a specific time point. To generate such data, enter a command that is similar to the following:

curl --data-urlencode "sdt=2015-10-30 00:00" -H "X-Auth-token: token" "http://yourdomain/api/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 do this, enter a command similar to the following:

curl --data "orderBy=un" --data-urlencode "sdt=2015-10-30 00:00" -H "X-Auth-token: token" "http://yourdomain/api/report/user-history/3/json"

Example 3

Say you need to view the first 100 sessions for feature 3 at a specific time point. To do this, 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: token" "http://yourdomain/api/report/user-history/3/json"

Showing sessions over a specific time period

If you want to retrieve information about usage history over a specific period of time, we recommend that you use the following URL request template:

GET /api/report/user-history/${featureId}/${returnType}?ssd=${sessionStartDate}&sed={sessionEndDate}&(additional parameters, as needed)

where:

- $ indicates a variable value that you can replace with an appropriate value, as needed

- the possible parameters are as follows:

ParameterRequiredTypeDescription
${featureId}YesintegerSpecifies feature-specific parameters.
${returnType}YesstringSpecifies the format in which license usage data should be returned. The format can be one of the following: json, csv, xls or pdf.
ssdYesstring

Specifies the start date for which the report will be generated in YYYY-MM-DD format; for example, 2016-01-20.

sedYesstring

Specifies the end date for which the report will be generated in YYYY-MM-DD format; for example, 2016-01-27.

fieldsVisibility  

Specifies field visibility settings, for example:

{"un": "1", "hn": "1", "sst": "1", "set": "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 Excel.
filterNojson/string

Applies filtering license usage data on all fields. To filter your data, use the following format:

[{"value": intOrString, "field": "${un | hn | sst | set}"}]
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.
orderByNostringSpecifies the field by which you want to order your data records. The field name can be one of the following: uid, un, hn, sst, set.
orderDirectionNostringDetermines 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:

FieldTypeDescription
uidintegerUser Id.
unstringUsername.
hnstringHostname.
sststringDate returned in YYYY-MM-DD HH:MM format; for example, 2016-01-20 11:00.
setstringDate returned in YYYY-MM-DD HH:MM format (for example, 2016-01-20 11:00), "Unknown", or "Still in use".
ilbooleanThis field indicates whether user details have been imported from LDAP directory. Note that you cannot filter and order data by this field.
messagestringError message returned on failure. 


Example 1

For example, say you would like to view all sessions for feature 3 over some period of time. To generate such data, enter a command that is similar to the following:

curl --data "ssd=2015-01-01" --data "sed=2015-01-02" -H "X-Auth-token: token" "http://yourdomain/api/report/user-history/3/json"

Example 2

Let's assume you want to see all sessions 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 "ssd=2015-01-01" --data "sed=2015-01-02" -H "X-Auth-token: token" "http://yourdomain/api/report/user-history/3/json"

Example 3

Let's assume you're interested in viewing the first 100 sessions 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 "ssd=2015-01-01" --data "sed=2015-01-02" -H "X-Auth-token: token" "http://yourdomain/api/report/user-history/3/json"


  • No labels