Weblutions Documentation
Weblutions Main Site Contact Us Our Discord
Product Documentation IconProduct Documentation

Weblutions Documentation / Product Documentation / Independent License System API

Updated

Independent License System API

By Josh M. 8 mins 13

This page contains all the API routes that are available in the Independent License System.

All route documentation is for versions 2.0.0 and up.

Table of Contents


Creating a API Token

To establish authentication to the Independent License Systems API a API token must be set in the configuration file.

  1. Open the config.json

  2. On line eight (by default) change the token to what is desired. Using a site RandomKeygen is recommended.

    A boring example image
    "apiKey": "123",
  3. Save the configuration file and restart Independent License System for changes to take effect.

Unset API Token Risks

If the installation of Independent License System has no API key set it opens the system to risk and abuse. Even if not using the API it's recommended to set a secure token.

Unauthorised Responses

If an API request is made with the incorrect or an invalid authorization header the below 403 response is returned.

"Not authorized to access this resource."

Get All License Keys

GET/api/keys
Returns an array of all license keys in the database.
Authorization
NameTypeRequiredDescription
authorizationStringrequired
Responses
200OKjson
View response body
[
  {
    "id": 3,
    "userId": "282762192544333827",
    "productId": 1,
    "status": 1,
    "lastRequest": "",
    "authIP": "1.1.1.1",
    "authKey": "4zWqp0Npqkcp3XT_42pIjrBP6kbR23kI2cahk0cSYx1EG",
    "disabled": 0,
    "iplocked": 0
  }
]

Get Single License Key

GET/api/keys/:id
Returns an object with the requested key information.
Authorization
NameTypeRequiredDescription
authorizationStringrequired
Path parameters
NameTypeRequiredDescription
idIntegerrequiredThe ID of the key as presented in the database and website.
Responses
200OKjson
View response body
{
  "id": 3,
  "userId": "282762192544333827",
  "productId": 1,
  "status": 1,
  "lastRequest": "",
  "authIP": "1.1.1.1",
  "authKey": "4zWqp0Npqkcp3XT_42pIjrBP6kbR23kI2cahk0cSYx1EG",
  "disabled": 0,
  "iplocked": 0
}
404Not Foundplaintext
View response body
License key not found.

Get Single License Key Logs

GET/api/keys/:id/logs
Returns the 100 most recent license logs in an array.
Authorization
NameTypeRequiredDescription
authorizationStringrequired
Path parameters
NameTypeRequiredDescription
idIntegerrequiredThe ID of the key as presented in the database and website.
Responses
200OKjson
View response body
[
  {
    "id": 147,
    "keyId": 3,
    "timeAt": "1788648761000",
    "authIP": "192.168.1.10",
    "details": "",
    "status": "AUTHORISED"
  }
]
404Not Foundplaintext
View response body
License key not found or there is no logs to show.

Check License Key Authorisation

POST/api/check/:productID
The API returns a JSON response indicating whether the license is valid.
Authorization
NameTypeRequiredDescription
authorizationStringrequiredThe license key to compare to the product and key details.
Path parameters
NameTypeRequiredDescription
productIDIntegerrequiredThe product ID to check.
Query parameters
NameTypeRequiredDescription
infoStringoptionalAdditional information to include in the license log.
logBooleanoptionalDefaults to true. Whether to log the request into the license logs database table.
Responses
200OKjson
View response body
{
    "status": "AUTHORISED",
    "pass": true,
    "details": "Status message"
}

List of response statuses:

  • AUTHORISED - Authorisation completed

    KEY DISABLED - This license key has been disabled by an administrator

    NOT ACTIVE - The supplied key is not active

    NOT AUTHORISED - The supplied IP is not authorised

    NOT FOUND - No key was provided

    NOT FOUND - The supplied license key was not found. Please check your auth key is correct


Create License Key

POST/api/keys
Creates a license key with the desired information.
Authorization
NameTypeRequiredDescription
authorizationStringrequired
Request body
NameTypeRequiredDescription
uidStringrequiredThe user ID to attach the license key to.
pidIntegerrequiredThe product ID to register the license key for.
statusBooleanoptionalThe active state of the license key.
ipStringoptionalThe authorised IP address for the license key to pass authentication.
disabledBooleanoptionalDetermines if the license key is force disabled. Defaults to false.
Responses
200OKjson
View response body
{
  "id": 4,
  "userId": "282762192544333827",
  "productId": 1,
  "status": 1,
  "lastRequest": null,
  "authIP": "",
  "authKey": "WrPF2MCWFLlyIteUYjr6drjM9hSGtXVpboaNx9xBH_6vI",
  "disabled": 0,
  "iplocked": 1
}
201OKplaintext
View response body
Data created but could not be read back immediately. Please fetch manually.
400Bad Requestplaintext
View response body
Missing body content. uid and pid are required.

Update License Key

PUT/api/keys/:id
Updates an existing license key details. Content defaults to existing data if not provided in the body. Returns updated key object.
Authorization
NameTypeRequiredDescription
authorizationStringrequired
Path parameters
NameTypeRequiredDescription
idIntegerrequiredThe ID of the key as presented in the database and website.
Request body
NameTypeRequiredDescription
disabledBooleanoptionalDetermines if the license key is force disabled. Defaults to false.
ipStringoptionalThe authorised IP address for the license key to pass authentication.
iplockedBooleanoptionalDetermines if the license key is locked only to the authorised IP address.
Responses
200OKjson
View response body
{
  "id": 3,
  "userId": "282762192544333827",
  "productId": 1,
  "status": 1,
  "lastRequest": "",
  "authIP": "1.1.1.1",
  "authKey": "4zWqp0Npqkcp3XT_42pIjrBP6kbR23kI2cahk0cSYx1EG",
  "disabled": 0,
  "iplocked": 0
}
404Not Foundplaintext
View response body
License key not found.

Delete License Key

DELETE/api/keys/:id
Deletes the desired license key and its logs. Returns the last license object before deletion.
Authorization
NameTypeRequiredDescription
authorizationStringrequired
Path parameters
NameTypeRequiredDescription
idIntegeroptionalThe ID of the key as presented in the database and website.
Responses
200OKjson
View response body
{
  "id": 3,
  "userId": "282762192544333827",
  "productId": 1,
  "status": 1,
  "lastRequest": "",
  "authIP": "1.1.1.1",
  "authKey": "4zWqp0Npqkcp3XT_42pIjrBP6kbR23kI2cahk0cSYx1EG",
  "disabled": 0,
  "iplocked": 0
}
404Not Foundplaintext
View response body
License key not found.