LICENSE4J offers a REST API designed for managing licenses on the license server. Through this API,
you can perform a variety of operations, including retrieving existing licenses, creating new licenses,
updating current license information, and deleting licenses that are no longer needed.
To access the REST API, you are required to create a unique API key for each product they intend to
manage. This process can be done on the Automation > Integrations page of the LICENSE4J platform. API key must be sent in a header with name
X-API-KEY. It is important to note
that each API key is restricted to accessing only one specific product, ensuring that license management for
different products remains organized and secure.
Get Licenses
URL: https://cloud.license4j.com/v5/api/license
Method: GET
Request: Query Parameters: licensekey, email, company, licensetype
This function returns a list of license objects formatted in JSON. If no query parameter is specified, the
function retrieves and returns all available licenses in the system. However, if a specific query parameter
is provided, the function will filter the results to include only those licenses that match the provided
input.
For instance, if you supply an email parameter, the function will return only the licenses associated with
email addresses that match the specified query. This capability allows for more targeted searches and
facilitates easier management of licenses based on specific criteria.
[
{
"id": 1179014318968977348,
"productId": 1446131546753861138,
"productName": "Example Product 0",
"licensekey": "MA2G7-PB9E3-69M4P-P557F-JCGCR",
"licensetype": "Floating",
"fullname": "Francine Hickey112",
"email": "francine@optisoft.com",
"company": "OptiSoft2",
"maxAllowedUsage": 1,
"validDays": 365,
"features": "",
"dateCreated": "2025-01-05 20:49:53",
"dateUpdated": "2025-01-14 01:31:17",
"dateExpires": null
},
{
"id": 1182657212911119418,
"productId": 1446131546753861138,
"productName": "Example Product 0",
"licensekey": "3BECB-YB4Y8-YUWKZ-NJ8ZJ-NAR9R",
"licensetype": "Floating",
"fullname": "James Cullen1121",
"email": "james@axiom.com",
"company": "Axiom 2",
"maxAllowedUsage": 1,
"validDays": 365,
"features": "",
"dateCreated": "2025-01-05 20:49:52",
"dateUpdated": "2025-01-14 01:54:16",
"dateExpires": null
}
]
Generate License
URL: https://cloud.license4j.com/v5/api/license
Method: POST
Request:JSON body, license request
To generate a license using a REST call, you'll need to craft a request that includes a body formatted
in
JSON. This request body should follow a specific structure, which is detailed in the example provided
below.
Make sure to include all necessary fields relevant to the license you wish to create, adhering to the
required data types and formats to ensure a successful transaction.
{
"licensetype": "FLOATING", // required, values: NODELOCKED or FLOATING
"fullname": "John Doe", // optional, string
"email": "john@example.com", // optional, string
"company": "ACME Comp.", // optional, string
"maxAllowedUsage": 1, // required, integer
"validDays": 365, // required, integer (0 for perpetual non-expiring licenses)
"keyCharacterSet": "SAFE", // required, values: SAFE NUMBERS LETTERS NUMBERS_AND_LETTERS or any custom characters minimum 10
"keyFormat": "LENGTH25_GROUP5" // required,
// values: LENGTH25_GROUP5 LENGTH20_GROUP5 LENGTH20_GROUP4 LENGTH16_GROUP4 or format like ?????-?????-?????
}
The system will return a license object, structured similarly to the example provided below.
Additionally,
the format will adhere to the same JSON structure utilized when retrieving licenses. This ensures
consistency in data representation, making it easier to handle and manipulate the information as needed.
{
"id": 1179014318968977348,
"productId": 1446131546753861138,
"productName": "Example Product 0",
"licensekey": "MA2G7-PB9E3-69M4P-P557F-JCGCR",
"licensetype": "Floating",
"fullname": "Francine Hickey112",
"email": "francine@optisoft.com",
"company": "OptiSoft2",
"maxAllowedUsage": 1,
"validDays": 365,
"features": "",
"dateCreated": "2025-01-05 20:49:53",
"dateUpdated": "2025-01-14 01:31:17",
"dateExpires": null
}
Update License
URL: https://cloud.license4j.com/v5/api/license
Method: PUT
Request:JSON body, license request
To initiate a license update, you need to submit the license request object that includes the
license key.
When this request is processed, all the properties that are defined in the object will be updated
accordingly. This includes the flexibility to modify any fields associated with the license, such as
the
type of license. You can even change the license key itself during this update process, and
you have the option to utilize different character sets to create the new key.
{
"licensekey": "12345-12345-12345-12345", // required
"licensetype": "FLOATING", // optional, values: NODELOCKED or FLOATING
"fullname": "John Doe", // optional, string
"email": "john@example.com", // optional, string
"company": "ACME Comp.", // optional, string
"maxAllowedUsage": 1, // optional, integer
"validDays": 365, // optional, integer (0 for perpetual non-expiring licenses)
"keyCharacterSet": "SAFE", // optional, values: SAFE NUMBERS LETTERS NUMBERS_AND_LETTERS or any custom characters minimum 10
"keyFormat": "LENGTH25_GROUP5" // optional,
// values: LENGTH25_GROUP5 LENGTH20_GROUP5 LENGTH20_GROUP4 LENGTH16_GROUP4 or format like ?????-?????-?????
}
Delete License
URL: https://cloud.license4j.com/v5/api/license
Method: DELETE
Request: Query Parameters: licensekey
The system performs a search for the specified license key within the database. If the license key
is located, it is promptly removed from the records. Upon successful completion of this process, the
system responds with an HTTP 200 status code, indicating that the operation was successful. This
ensures that the user is informed of the successful deletion of the license key.