...
License Statistics API allows you to 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.
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
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" |
Sample script
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.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
$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" } |
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:
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
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
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.
...