The information on this page refers to License Statistics versions prior to v6.3. This information no longer applies to License Statistics v6.3 and newer.


The User History endpoint delivers license usage metrics specific to the User History report, allowing you to see statistics for license usage per user, during any period that usage was tracked.

Showing sessions at a specific point in time

You can easily fetch metrics about user session history by sending the following HTTP request.

GET /api/v1/report/feature/${featureId}/user-history/${returnType}?(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}YesintegerInternal License Statistics identification of the feature for which you want to view user history.
${returnType}YesstringStandard format option. See Making an API request for details.
sdtNodate and timePoint in time for which you want to generate the report. Cannot be used with "ssd" and "sed".
ssdNodate

Start date for which the report will be generated.

sedNodate

End date for which the report will be generated.

standard report optionsNovarious

See Making an API request for details.

Note: Either "sdt" or both "ssd" and "sed" must be specified.

Response

On success, this report will contain:


Each row consists of the following columns.
FieldFull nameTypeDescriptionVisible by default in export
uidUser IDintegerUser ID.(minus) No
unUserstringUsername.(tick) Yes
hnHoststringHostname.(tick) Yes
sstStart Timedate and time
Time when the license was checked out.(tick) Yes
setEnd Timedate and time/stringTime when the license was checked in, or "Still in use."(tick) Yes
tuTime UsedstringHow long the license has been in use. Note that you cannot filter on this field.(tick) Yes
uilUser is from LDAPbooleanIndicates whether user details have been imported from the LDAP directory. Note that you cannot filter and order data by this field.(error) Unavailable

Note that order in table is default order of columns in exported file.


Example 1

The following example shows a command that lets you obtain information about all sessions for feature "3" at a specified time point.

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

Example 2

The following example shows a command that lets you obtain statistics about all sessions for feature "3" at a specified time point.

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

Example 3

The following example shows a command that lets you view the first 100 sessions for feature "3" at a specified time point.

curl --data "limit=100" --data "offset=0" --data-urlencode "sdt=2015-10-30 00:00" -H "X-Auth-token: token" "http://yourdomain/api/v1/report/feature/3/user-history/json"


Example 4

The following example shows a command that lets you view all sessions for feature "3" for a specified time period.

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

Example 5

The following example shows a command that lets you see all sessions for feature "3" for a specified time period, and orders the data by username.

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

Example 6

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

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/v1/report/feature/3/user-history/json"

Sample script 1

This sample PowerShell 3.0 script serves as a template for generating PDF reports to a file for features with a specific name and for a license server of your choosing. The script saves reports to a file under a filename that follows the pattern: UserHistory-${featureId}.pdf. You can easily adapt this script to any target parameters you'd like to use to generate the desired report. The number of generated PDF files corresponds to the number of features meeting the defined criteria.

$token = "Yourtoken"
$url = "http://yourdomain/api/v1/report"
$features = Invoke-RestMethod "$($url)/feature/json?fns=FeatureName&lsn=LicenseServerName" -Headers @{"X-Auth-token"="$($token)"}

for ($i=0; $i -lt $features.data.fid.Length; $i++) { 
    Invoke-RestMethod "$($url)/feature/$($features.data.fid[$i])/user-history/pdf?sdt=2016-02-03 00:00" -Headers @{"X-Auth-token"="$($token)"} -OutFile "UserHistory-$($features.data.fid[$i]).pdf"
}

Sample script 2

This sample PowerShell 3.0 script can be used as a template for generating PDF reports to a file for features with a specific name and for a license server of your choosing. The script saves reports to a file under a filename that follows the pattern: UserHistoryForPeriod-${featureId}.pdf. You can easily adapt this script to any target parameters you'd like to use to generate the desired report. The number of generated PDF files corresponds to the number of features meeting the defined criteria.

$token = "Yourtoken"
$url = "http://yourdomain/api/v1/report"
$features = Invoke-RestMethod "$($url)/feature/json?fns=FeatureName&lsn=LicenseServerName" -Headers @{"X-Auth-token"="$($token)"}

for ($i=0; $i -lt $features.data.fid.Length; $i++) { 
Invoke-RestMethod "$($url)/feature/$($features.data.fid[$i])/user-history/pdf?ssd=2016-02-03&sed=2016-02-10" -Headers @{"X-Auth-token"="$($token)"} -OutFile "UserHistoryForPeriod-$($features.data.fid[$i]).pdf"
}