Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


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
languagejs
firstline1
linenumberstrue
curl -H "X-Auth-token: token" "http://yourdomain/url-to-api?parameter=value&parameter2=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.

OperatorNumberDateDate and time
eqequal to ${operator_value}during day ${operator_value}
ltless than ${operator_value}before day ${operator_value}before hour 00:00 of day ${operator_value}
gtless 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
languagejs
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
languagejs
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
languagejs
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
languagejs
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.

TypeMIME type

Description

csvtext/csvSemicolon-separated values. Records separated by Windows line separator (CRLF)
xlsxapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheetMicrosoft Office 2007 spreadsheet format
pdfapplication/pdfAdobe PDF format