Introduction
This document provides an overview of how to utilize the Licensing API to monitor and manage license usage effectively. By leveraging this API, administrators can retrieve real-time data on the number of active users and enforce user limits for optimal license allocation.
In order to access the license usage data, two steps need to be performed:
- Obtain the authentication token
- Retrieve license data.
Here is how to do that.
1. Obtaining the authentication token
To gain access, you must first acquire an authentication token by sending a POST request to the auth/login
endpoint. The request should contain the following parameters.
Element | Description |
Endpoint | POST <protocol>://<host>:<port>/__base__/auth/login |
<protocol> | Specify either http or https . |
<host>:<port> | The URL of the gateway implementation. |
Query Parameters | None |
Example Request: POST http://162.254.24.208:9443/__base__/auth/login
Request Body (JSON)
{
"clientID": "4F5F926E-42D9-4F78-9C14-FFD0747A8036",
"clientSecret": "kklri2mqy7ulrt4y57zdlxd8d1ab4nl9",
"context": "API Access"
}
The clientID
can be configured or obtained from the Thinfinity Configuration Manager. To do that, first, navigate to the Authentication>Methods tab and click Add to set API access as an authentication method. Next, double-click on the API Access method to access the Authentication Method Settings dialog window. Alternatively, select the API Access method from the list and click Edit.
In the Authentication Method Settings dialog window click Add to bring up the API User dialog window.
From the API User dialog window copy the ClientID and the ClientSecret for the next step.
Response Example
Upon a successful POST request, you will receive a response similar to the following:
{
"data": {
"gwsid": "",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expirationSecs": 120
}
}
token
: Use this for subsequent API requests.expirationSecs
: The duration (in seconds) for which the token is valid, as configured in API User dialog window (Token validity field).
2. Retrieving License Usage Data
Once you have the authentication token, you can query the license usage information.
Element | Description |
Endpoint | GET <protocol><host>:<port>/__base__/licenses/usage |
Authorization Header | Authorization: Bearer <token> |
Example request: GET http://162.254.24.208:9443/__base__/licenses/usage
Response Example
{
"data": {
"res": "0",
"licenses": [
{
"product": "Thinfinity Workspace v7.0",
"serial": "ZAWM-QIIA-ONGR-5524-BJWQ-WSEQ-SZGF-EOY7",
"usage": {
"users": 0,
"seats": 1
}
}
]
}
}
users
: The number of active licenses (concurrent users).seats
: The total number of available licenses.
Attachments
Refer to the Postman API collection provided for testing these requests.