Licenses
Our service allows you to manage your licenses in other applications by using REST API.
Create
To create a license you need to send a request to the REST API by following instructions.
Body parameters
keystring required
Unique identifier for the license.productIdlong required
Product ID associated with the license.descriptionlong
Detailed description of the license.clientNamelong required
Name of the client who owns the license.emailstring
Email address associated with the license.discordIdlong
Discord ID linked to the license. (available discord bot integration)addressLimitint
Maximum number of addresses allowed for this license.addressDurationint
Duration limit for each address under the license. (in days)assignedAddressstring
Assigned IP address for the license.machineLimitint
Maximum number of machines allowed under this license.machineDurationint
Duration limit for each machine under the license. (in days)assignedMachinestring
Assigned machine identifier for the license.durationlong
Total duration of the license in months.deleteAfterExpireboolean
Whether the license should be automatically deleted after expiration.addonsarray
Array of addon IDs associated with the license.
Codes
| Status Code | Description |
|---|---|
401 | You don't have permission to create license. |
409 | License with this key already exists. |
423 | You don't have any plan assigned or you have reached the limit of licenses. |
201 | License created successfully. |
Sample request
curl -X PUT https://api.mlicense.net/api/v1/licenses \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: {API_KEY}' \
-d '{
"key": "IAJAS-ASDAS-ASDAS-ASDAS-ASDAS",
"productId": 12312,
"clientName": "mLicense Dev",
"email": "[email protected]"
}'Sample token
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5cSample response
{
"id": 1,
"key": "example-key",
"productId": 123456789,
"description": "Example license description",
"clientName": "John Doe",
"email": "[email protected]",
"discordId": 987654321,
"addressLimit": 5,
"addressDuration": 30,
"assignedAddress": "192.168.1.1",
"machineLimit": 3,
"machineDuration": 60,
"assignedMachine": "Machine-1234",
"duration": 365,
"deleteAfterExpire": true,
"addons": [111, 222, 333]
}Update
To update a license you need to send a request to the REST API by following instructions.
Body parameters
idlong required
Unique identifier for the license.keystring
Unique identifier for the license.productIdlong
Product ID associated with the license.descriptionstring
Detailed description of the license.clientNamestring
Name of the client who owns the license.emailstring
Email address associated with the license.discordIdlong
Discord ID linked to the license. (available discord bot integration)addressLimitint
Maximum number of addresses allowed for this license.addressDurationint
Duration limit for each address under the license. (in days)assignedAddressstring
Assigned IP address for the license.machineLimitint
Maximum number of machines allowed under this license.machineDurationint
Duration limit for each machine under the license. (in days)assignedMachinestring
Assigned machine identifier for the license.durationint
Total duration of the license in months.deleteAfterExpireboolean
Whether the license should be automatically deleted after expiration.addonsarray
Array of addon IDs associated with the license.
Codes
| Status Code | Description |
|---|---|
401 | You don't have permission to create license. |
404 | License not found. |
409 | License with this key already exists. |
423 | You don't have any plan assigned or you have reached the limit of licenses. |
200 | License updated successfully. |
Sample request
curl -X POST https://api.mlicense.net/api/v1/licenses \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: {API_KEY}' \
-d '{
"id": 1,
"key": "HGA!@-ASDAS-ASDAS-ASDAS-ASDAS",
}'Sample token
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5cSample response
{
"id": 1,
"key": "HGA!@-ASDAS-ASDAS-ASDAS-ASDAS",
"productId": 123456789,
"description": "Example license description",
"clientName": "John Doe",
"email": "[email protected]",
"discordId": 987654321,
"addressLimit": 5,
"addressDuration": 30,
"assignedAddress": "192.168.1.1",
"machineLimit": 3,
"machineDuration": 60,
"assignedMachine": "Machine-1234",
"duration": 365,
"deleteAfterExpire": true,
"addons": [111, 222, 333]
}Get
To get a license you need to send a request to the REST API by following instructions.
Remember get all return JsonArray with all licenses objects.
Request parameter
idlong required for (licenses/id)
Unique identifier for the license.keystring required for (licenses/key)
Unique identifier for the license.
Codes
| Status Code | Description |
|---|---|
401 | You don't have permission to view this license. |
404 | License not found. |
200 | Return license. |
Sample request for ALL
curl -X GET https://api.mlicense.net/api/v1/licenses/all \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: {API_KEY}'Sample request for ID
curl -X GET https://api.mlicense.net/api/v1/licenses/id?id=LICENSE_ID \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: {API_KEY}'Sample request for KEY
curl -X GET https://api.mlicense.net/api/v1/licenses/key?key=LICENSE_KEY \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: {API_KEY}'Sample token
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5cSample response
{
"id": 1,
"key": "HGA!@-ASDAS-ASDAS-ASDAS-ASDAS",
"productId": 123456789,
"description": "Example license description",
"clientName": "John Doe",
"email": "[email protected]",
"discordId": 987654321,
"addressLimit": 5,
"addressDuration": 30,
"assignedAddress": "192.168.1.1",
"machineLimit": 3,
"machineDuration": 60,
"assignedMachine": "Machine-1234",
"duration": 365,
"deleteAfterExpire": true,
"addons": [111, 222, 333]
}Delete
To delete a license you need to send a request to the REST API by following instructions.
Request parameter
idlong required
Unique identifier for the license.
Codes
| Status Code | Description |
|---|---|
401 | You don't have permission to delete this license. |
404 | License not found. |
204 | License successfully deleted. |
Sample request
curl -X DELETE https://api.mlicense.net/api/v1/licenses?id=LICENSE_ID \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: {API_KEY}'Sample token
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c