Using the REST API
In this section, we will walkthrough the POSTMAN collections (provided by Thales) to consume license using the REST API.
Prerequisite
In this demonstration, we are using the POSTMAN tool. Import all the POSTMAN json files in the POSTMAN tool. The package contains the collections for Cloud License Manager APIs, Token Management Service REST API, Environment variables and Global variables.
In this step, you will set the following Sentinel variables required to use the Cloud LM REST APIs. Refer to your Sentinel order email for the variable values that you will set.
Sentinel Variable | Available in... |
---|---|
baseUrl | <TenantHostAddress> where, <TenantHostAddress> is available in the Sentinel order email. |
ISVsecretKeyId | Secret Key ZIP file. |
ISVsecretKey |
In this section, with the help of an animated video, you will see the process of generating an auth token using the registration token. For details about the registration token and auth token, refer to Sentinel RMS API Reference Guide.
The major steps performed in the video are:
•Copying the registration token created in Part 2: Generating a Registration Token.
•Setting the global variables in the POSTMAN tool—registrationToken, appUserName, and appUserComputerName.
•Generating an auth token that contains an access token and a refresh token.
•Ensuring that you save the auth token for authentication.
NOTE The videos in this tutorial were made with earlier versions of Sentinel EMS. We recommend checking out the latest features available in the current version.
In this section, with the help of an animated video, you will see the use of access token (generated in the previous step) to consume the license.
The major steps performed in the video are:
•Setting the access token as appUserAccessToken global variable.
•Setting the parameters (feature name and feature version) for calling the login API. To simplify the introduction, we have removed some of the variables like units, usageCountMultiplier, and vendorUsageData.
•Calling the login API.
•Setting the response body as it is licenseSession global variable
•Setting the location from header as licenseSessionId global variable
•Calling the refresh API
•Setting the response body as licenseSession global variable
•Setting the location from header as licenseSessionId global variable
•Calling the release API
Click the image on the right to watch the instructional video
NOTE The videos in this tutorial were created using earlier versions of Sentinel EMS and have not been updated to reflect the latest features
In this section, with the help of an animated video, you will see how to obtain the refresh token.
Access token lifetime is short, therefore, requires renewal. In this step, you will use the refresh token to generate a new access token.
Refer to Step 2: Generate Auth Token described earlier to obtain the access token and refresh token.
NOTE You should refresh the access token before the refresh token expiry.
Click the image on the right to watch the instructional video
NOTE The videos in this tutorial were created using earlier versions of Sentinel EMS and have not been updated to reflect the latest features