[wc_login_form_rk]
[wc_reg_form_rk]
Close

Get the Data Your Way: The License Statistics API

Of course you know License Statistics delivers the data you need to control license and license server costs. But did you know you can also display all that great data in the BI dashboards and reports you already use every day?

That’s right: The License Statistics API makes it easy to extract the data you need and integrate it into your own business processes. Display critical license data along with the other key indicators you track daily in reports, dashboards, and other BI tools. Use the API to automate report generation and make it readily available to your manager or a specific department in your organization.

The License Statistics API is an invaluable tool for advanced users and systems integrators who want to create their own views into critical business data. The License Statistics UI shows you just what can be done with the API, as it uses the same API to display data in your web browser. 

With the License Statistics v6.3 release, interactive API documentation is now embedded in the UI using Swagger (https://swagger.io/).

Getting Started with the API

The API gives you flexible, on-demand access to License Statistics data in an easy-to-extract format. You can request results in JSON, csv, PDF, or xlxs formats, so you have a wide variety of options for accessing and using the data. Use the API with your custom external applications, off-the-shelf BI tools, and reporting systems.

Getting started with the License Statistics API is as simple as enabling API access, generating a token, and making your first API request. Once you have enabled API access in your License Statistics account, you then generate an access token. 

Generating and Using API Tokens

API access tokens are unique identifiers associated with your account that are used to authenticate your data requests in the API. Tokens cannot be shared, so you’ll need to create a token for every user requiring access.

Once you’ve generated an API access token, you’ll add the HTTP header “X-Auth-token” to every request you make. Make requests directly using your web browser, or use an HTTP client like cURL to get the data in a variety of useful formats. Here’s a cURL example:

curl -H "X-Auth-token: token" "http://yourdomain/url-to-api"

Making API Requests

A basic API request uses the GET method to pass report parameters in a query string. The basic API request looks like this:

curl -H "X-Auth-token: token" "http://yourdomain/url-to-api?parameter=value&parameter2=other_value"

(“yourdomain” is the URL on which License Statistics v6.3 is installed.)

Any data you can see in the License Statistics UI can be accessed using the API and brought into your reporting tools. There are 18 API endpoints provided by License Statistics, each of which delivers specific license usage metrics.

Useful Examples

Example: Return a list of all features recognizable by License Statistics

The cURL command:

curl -H “X-Auth-token: token” “http://yourdomain/api/v1/feature/csv

will return a csv format file containing one row for each feature recognizable by License Statistics.

Example: Return a list of feature information filtered by name and version, output to csv format

The cURL command:

curl --data "filter=[{"type"="string", "field"="fn", "value"="abc"}, {"type"="string", "field"="fv", "value"="2.1"}]" -H "X-Auth-token: token" "http://yourdomain/api/v1/feature/csv"

will return a csv format file containing one row for each feature, filtered by name and version.

Example: Return information in json format for a feature with an ID of “1”.

The cURL command:

curl --data-urlencode "filter=[{"type"="numeric", "field"="fid", "comparison"="eq" "value"="1"}]" -H "X-Auth-token: token" "http://yourdomain/api/v1/feature/json"

will return a json file containing the information about the specified feature.

Conclusion

The License Statistics API is an easy-to-use tool for integrating License Statistics data into your own business processes. Ready to get started? Go to the “Using the License Statistics API” section of the online documentation for complete details.