REST API

Note

Beginning with License Server version 3.2.3, a selection of REST API queries has been deprecated. Some of these queries referred to internal model objects that caused confusion.

These deprecated queries include:

  • /api/groups/*
  • /api/rebels/*
  • /api/tokens/status
  • /api/leases/*
  • /api/statistics/*

REST API enables to get raw data for off-site analysis and storage. It is reachable via /api.


REST API authentication

Grab the API key from your profile page: License Server > Configuration > My Profile > API Key.

../_images/api-key.png

You need to append your API Key as a GET parameter to the URL of each REST API request:

GET /api/status/seats?token=<my authentication token>

Status queries

Query seat usage information

A query that will provide you with information about how many seats are available in the system and how many are in use, per license type and product.

Request:

GET /api/status/seats

Response:

{
   "seats.jrebel-standalone.total":1103,
   "seats.jrebel-standalone.used":101,
   "seats.jrebel-standalone.free":1002,
   "seats.jrebel-standalone.managed.total":999,
   "seats.jrebel-standalone.managed.used":101,
   "seats.jrebel-standalone.managed.free":898,
   "seats.jrebel-standalone.floating.total":104,
   "seats.jrebel-standalone.floating.used":0,
   "seats.jrebel-standalone.floating.free":104,
   "seats.xrebel-standalone.total":111,
   "seats.xrebel-standalone.used":6,
   "seats.xrebel-standalone.free":105
}

CSV endpoints

While not necessarily part of the REST API, License Server also implements a couple of endpoints that return data in CSV format. Downloading the CSVs is also available via the UI from the corresponding sections under Analytics.

Downloading the CSV data presume you are logged in as a UI user.


Query for time savings data by groups

GET /reports/time-series.csv?interval=day&from=2016-12-25&to=2017-01-05

Note

While this API was also available before, the parameters in the format described here are supported as of License Server 3.3.3. Please upgrade to this version to use this API.

  • All parameters are optional.
  • interval takes values day, month or year. The CSV data is generated in respective units of time. Defaults is months.
  • from and to define the period of time for which CSV data will be returned. Dates are expected in format yyyy-mm-dd.
  • If both from and to are missing, it defaults to last 365 days.
  • If only from is missing, data is returned since the beginning of history in the database.
  • If only to is missing, data is returned until current date.