REST API

The web application uses REST API to communicate with our license server. You can use the same REST API to automatically manage your assets. This could be useful if you have a large amount of licenses to manage or you want to automatically activate the Runtime Keys.

The REST API contains more than 18 operations but only 2 are worth automating:

For the next sections the activation address is obfuscated and replaced with activation-host-and-port to avoid spamming. You should have received the real address along with your connection information.

Generate Slave Key

See previous sections to understand why a Slave Key is needed.

POST /slaves

Add a slave using the Master Key provided in the request body.

Example request:

POST /slaves HTTP/1.1
Content-Type: application/json; charset=utf-8

{
   "masterKey": "7JCVgZbGwFB2USAlIaDyxvQm1geERImHvY24tTm5tcWVpAr//r6dcXNSVw==",
   "comment": "Slave key sent to company X on 05/07/19 via email"
}

Example response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
   "organisation": "29f45dfa37864357d8c02aa4",
   "master": "5c80f8f9fe12df25ad48c25b",
   "used": false,
   "createDate": 1576522350647,
   "key": "A0ZDc2PDcMcXtkAkp/AGIC9jQQ0YGcwOW4CDslQ2OmAV9XUVZ2MZTVbS0paLiIOHDQ3Mzw0NTxmck5WTX0KWHhUFvPL+scjU8PUSsPCThZA8OjU1YDFQaddyHeAFmMkUPjwSVxtaajU="
}
Request JSON Object
  • masterKey (string) – your base64 secret Master Key. You must be the one executing this request because the Master Key must be kept secret. You must not execute this request on the end user computer.

  • comment (string) – optional field to add comment to the slave. This could be helpful if you want to track the slaves. We recommend adding the end user contact information in this field.

Response JSON Object
  • organisation (string) – the organisation identifier associated to the newly created slave. This is your organisation id.

  • master (string) – the master identifier associated to the newly created slave. This is a more friendly string than MasterKey to track the slaves.

  • used (bool) – whether the slave is already used. Must be false.

  • createDate (date) – date defining when the slave was created.

  • key (string) – the newly generated Slave Key to share with the end user or include in the application.

Status Codes

Activate Runtime Key

To activate a Runtime Key you’ll need a Master or Slave Key. If you’re doing the operation by yourself then, you can use your Master Key. Otherwise, a Slave Key must be used to avoid sharing your secret Master Key. See previous section on how to generate a Slave Key.

POST /activate

Activate a Runtime Key using a Master or Slave Key provided in the request body.

Example request:

POST /activate HTTP/1.1
Content-Type: application/json; charset=utf-8

{
   "masterOrSlaveKey": "7JCVgZbGwFB2USAlIaDyxvQm1geERImHvY24tTm5tcWVpAr//r6dcXNSVw==",
   "runtimeKey": "bGwFB2UgeERImHvY24tTr//r6dcXm5tSAlIaDyxV7JvQm1cWCVgZpANSVw=="
}

Example response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
  "token": "IaDyxvQm1gZbGweERIFB2bGwFB2USAlmHvY2==",
  "totalCredit": 300,
  "usedCredit": 17
}
Request JSON Object
  • masterOrSlaveKey (string) – your base64 secret Master or Slave Key generated as previously explained.

  • runtimeKey (string) – base64 string uniquely identifying a device.

Response JSON Object
  • token (string) – this is the actual license key (base64) to use in the application to unlock all the features.

  • totalCredit (int) – total credit units on your balance.

  • usedCredit (int) – used credit units on your balance after the activation operation. Multiple activation operations on the same Slave or Runtime Key will only decrease this entry by 1-unit.

Status Codes
  • 201 Created – no error

  • 400 Bad Request – master or slave key is invalid. Same code is returned when the usedCredit >= totalCredit before activation.