Skip to content

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 CodeDescription
401You don't have permission to create product.
409Product with thisn name already exists.
423You don't have any plan assigned or you have reached the limit of products.
201Product created successfully.

Sample request

http
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

text
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

Sample response

json
{
  "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 CodeDescription
401You don't have permission to create product.
404Product not found.
423You don't have any plan assigned or you have reached the limit of products.
201Product updated successfully.

Sample request

http
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

text
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

Sample response

json
{
  "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 CodeDescription
401You don't have permission to view this product.
404Product not found.
200Return product.

Sample request for ALL

http
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

http
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

http
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

text
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

Sample response

json
{
  "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 CodeDescription
401You don't have permission to delete this product.
404Product not found.
204Product successfully deleted.

Sample request

http
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

text
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c