The information on this page refers to License Statistics v6.18 and newer, which added the ability to change default column names. If you are using a version previous to v6.18, see documentation for previous versions. |
To generate a License Statistics report of your choosing, you can use any browser or an HTTP client (cURL). cURL is a library and command-line tool that can be used to access HTTP-based web services and websites.
...
Use the GET method to pass report parameters in a query string. Authenticate the request using a generated token.
Example request
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
curl -H "X-Auth-token: token" "http://yourdomain/url-to-api?parameter=value¶meter2=other_value" |
where "yourdomain" is the domain where License Statistics is installed.
Info |
---|
Note that if your installation uses either a port different than 80, or port 443 for SSL-secured HTTPS, you will need to provide the port number as well. |
...
This filter lets you either specify equality (default) or a range operator, but not both.
Operator | Number | Date | Date and time |
---|---|---|---|
eq | equal to ${operator_value} | during day ${operator_value} | |
lt | less than ${operator_value} | before day ${operator_value} | before hour 00:00 of day ${operator_value} |
gt | less than ${operator_value} | after day ${operator_value} | after hour 23:59 of day ${operator_value} |
Example 1: Hour used (hu) between e and π will match 2.72, 3 and 3.14, but will not match 2.7183 or 3.1415.
...
Code Block | ||
---|---|---|
| ||
filter=[{"property":"ftype","value":["Floating","Token"]}] |
Columns
Column selection
By default, the report shows a subset of columns in left-to-right order. To show invisible columns, hide visible columns, or reorder columns, use the "fieldVisibility" parameter. This works for CSV, XLSX and PDF endpoints.
...
Code Block | ||
---|---|---|
| ||
fieldVisibility="{"lsid":"1","lsn":"1","fid":"1","fns":"1"} |
Column headers
By default, the report shows pre-defined column headers. To change the default headers, use the "fieldsHeaders" parameter. This parameter works only for CSV, XLSX and PDF endpoints.
Example: to set custom names for two columns:
Code Block | ||
---|---|---|
| ||
fieldsHeaders={"lsid":"Custom Id","lsn":"Custom Name"} |
Limiting and ordering
...
results
You can order results using the parameters "orderBy" and "orderDirection", order" parameter and limit record count using the parameters "offset" and "limit." . Order is applied first, then offset and limit.
- orderBy - column order - list of columns and directions to order by
- orderDirection - ASC to use ascending order, or DESC to use descending order
- offset - rows to skip at the beginning of sorted result
- limit - maximum number of rows to return
Example: Sort rows by checkout time ("lco") in descending order and include rows from 10th to 14th
Code Block | ||
---|---|---|
| ||
order: [{"property":"vn","direction":"DESC"},{"property":"lsn","direction":"ASC"}]
offset: 9
limit: | ||
Code Block | ||
?orderBy=lco&orderDirection=DESC&offset=9&limit=5 |
Response
The API can respond with the following codes.
...
If the URL ends with /csv, /xlsx or /pdf it will return a file in the corresponding format, as described below.
Type | MIME type | Description |
---|---|---|
csv | text/csv | Semicolon-separated values. Records separated by Windows line separator (CRLF) |
xlsx | application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | Microsoft Office 2007 spreadsheet format |
application/pdf | Adobe PDF format |