Products
Our service allows you to manage your products in other applications by using REST API.
Create
To create a product you need to send a request to the REST API by following instructions.
Body parameters
name
string required
Product name.version
string required
Product version.builtByBitResourceId
long BuiltByBit Integration
Resource ID of the built by Bit resource.mainClass
string Java ClassLoader
Main class of the product.file
object Java ClassLoader
File object of the product.file.id
long Java ClassLoader
File ID of the product.file.name
string Java ClassLoader
File name of the product.file.data
file byte array as base64 Java ClassLoader
File data of the product.
Codes
Status Code | Description |
---|---|
401 | You don't have permission to create product. |
409 | Product with thisn name already exists. |
423 | You don't have any plan assigned or you have reached the limit of products. |
201 | Product created successfully. |
Sample request
curl -X PUT https://api.mlicense.net/api/v1/products \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: {API_KEY}' \
-d '{
"name": "mLicense",
"version": "1.0.0"
}'
Sample token
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Sample response
{
"id": 0,
"name": "string",
"version": "string",
"builtByBitResourceId": 0,
"mainClass": "string",
"binaryFileId": 0
}
Update
To update a product you need to send a request to the REST API by following instructions.
Body parameters
id
long required
Unique identifier for the product.name
string required
Product name.version
string required
Product version.builtByBitResourceId
long BuiltByBit Integration
Resource ID of the built by Bit resource.mainClass
string Java ClassLoader
Main class of the product.file
object Java ClassLoader
File object of the product.file.id
long Java ClassLoader
File ID of the product.file.name
string Java ClassLoader
File name of the product.file.data
file byte array as base64 Java ClassLoader
File data of the product.
Codes
Status Code | Description |
---|---|
401 | You don't have permission to create product. |
404 | Product not found. |
423 | You don't have any plan assigned or you have reached the limit of products. |
201 | Product updated successfully. |
Sample request
curl -X POST https://api.mlicense.net/api/v1/products \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: {API_KEY}' \
-d '{
"id": 1,
"version": "1.0.1",
}'
Sample token
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Sample response
{
"id": 0,
"name": "string",
"version": "string",
"builtByBitResourceId": 0,
"mainClass": "string",
"binaryFileId": 0
}
Get
To get a product you need to send a request to the REST API by following instructions.
Remember get all return JsonArray with all products objects.
Request parameter
id
long required for (products/id)
Unique identifier for the product.name
string required for (products/name)
Product name.
Codes
Status Code | Description |
---|---|
401 | You don't have permission to view this product. |
404 | Product not found. |
200 | Return product. |
Sample request for ALL
curl -X GET https://api.mlicense.net/api/v1/products/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/products/id?id=PRODUCT_ID \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: {API_KEY}'
Sample request for NAME
curl -X GET https://api.mlicense.net/api/v1/products/name?name=PRODUCT_NAME \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: {API_KEY}'
Sample token
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
Sample response
{
"id": 0,
"name": "string",
"version": "string",
"builtByBitResourceId": 0,
"mainClass": "string",
"binaryFileId": 0
}
Delete
To delete a product you need to send a request to the REST API by following instructions.
Request parameter
id
long required
Unique identifier for the product.
Codes
Status Code | Description |
---|---|
401 | You don't have permission to delete this product. |
404 | Product not found. |
204 | Product successfully deleted. |
Sample request
curl -X DELETE https://api.mlicense.net/api/v1/products?id=PRODUCT_ID \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: {API_KEY}'
Sample token
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c