The License Usage API provides access to tool license usage information. The API endpoints use access logs stored in DTP. By default, logs are stored for the last 90 days. See Configuring License Server for information about changing how long logs are stored.

Accessing the API Page

  1. Choose License Server from the Report Center settings drop-down men (gear icon).
  2. Choose Management> Tools Usage to access the API.

You can right-click on an endpoint to copy the URL and use it in a script. You can also query the endpoint in your browser to quickly view the data. For example: 

  1. Paste the URL into a browser bar and add any additional queries.
  2. Press the Return key to query the endpoint.

Calling the API Programmatically

You have to be logged in to use the API. Basic authentication is not supported, however, so you must first send a login request to DTP, capture the cookie created during authentication, and include the cookie in your GET method call to the API.   

Example 

Send a POST request to the login page and capture the cookie. Include your credentials in the payload using the  j_username and j_password parameters. Basic authentication (-u) is not supported. 

curl -v --data 'j_username=<your_username>&j_password=<your_password>' https://<host>/grs/pst_login_request --cookie-jar cookies.txt

Pass the cookie in your GET request to the API endpoint.

curl -https://<host>/licenseserver/usage/api/v1.0/toolsUsage --cookie-jar cookies.txt
  • No labels