APIs for managing license

You can use the following APIs to manage the license.

Syntax

Description

/api/License/LoadLicenseInfo

Loads the license.

/api/License/LoadInstanceInfo

Loads the server instance.


LoadLicenseInfo

Loads the license.

Syntax: GET /api/License/LoadLicenseInfo

PowerScript code example:

Integer li_rc
String ls_body 
httpclient  lhc_client
lhc_client = create httpclient

lhc_client.setrequestheader("Content-Type", "application/json;charset=UTF-8",true)

li_rc  = lhc_client.sendrequest( "GET", "http://172.25.100.32:5000/api/License/LoadLicenseInfo")
if li_rc = 1 and lhc_client.getresponsestatuscode( ) = 200 then
 lhc_client.getresponsebody(ls_body)
end if

When successful, it returns the response status code 200 and the following response body:

When failed, it returns 400 (bad request), 401 (unauthorized), or 500 (server error).

{
  "licenseKey": "string",
  "productEdition": "string",
  "watermark": "string",
  "sessionNumber": 0,
  "sessionUsed": 0,
  "startTime": "2022-02-18T08:24:58.382Z",
  "expireTime": "2022-02-18T08:24:58.382Z",
  "supportStartTime": "2022-02-18T08:24:58.382Z",
  "supportExpireTime": "2022-02-18T08:24:58.382Z",
  "isUsable": true
}

LoadInstanceInfo

Loads the server instance.

Syntax: GET /api/License/LoadInstanceInfo

PowerScript code example:

Integer li_rc
String ls_body 
httpclient  lhc_client
lhc_client = create httpclient

lhc_client.setrequestheader("Content-Type", "application/json;charset=UTF-8",true)

li_rc  = lhc_client.sendrequest( "GET", "http://172.25.100.32:5000/api/License/LoadInstanceInfo")
if li_rc = 1 and lhc_client.getresponsestatuscode( ) = 200 then
 lhc_client.getresponsebody(ls_body)
end if

When successful, it returns the response status code 200 and the following response body:

When failed, it returns 400 (bad request), 401 (unauthorized), or 500 (server error).

{
  "instanceKey": "string",
  "instanceName": "string",
  "powerServerVersion": "string",
  "powerServerReleaseDate": "2022-02-18T08:29:57.558Z"
}