REST API

Note

Beginning with 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: Rebel Licenses On-Premise > 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.xrebel-standalone.total":111,
   "seats.xrebel-standalone.used":6,
   "seats.xrebel-standalone.free":105
}

CSV endpoints

While not necessarily part of the REST API, Rebel Licenses On-Premise 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 version 3.3.3. Please upgrade to the latest version of Rebel Licenses On-Premise 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.