OPL-AI API Documentation

OPL-AI API is a powerful RESTful API platform offering work tracking, location monitoring, optimization, and classification services. Powered by advanced artificial intelligence models, our modules enhance your business operational efficiency.

Authentication

To use the OPL-AI API, you need a valid license key. The licenceKey parameter is required for all API requests.

How to Obtain a License Key?
  1. Register on the system
  2. Log in to your account
  3. Request your license key from the Licence & Data section
Important: Keep your license key secure and never share it in public code repositories.

Work Tracking Module

The Work Tracking module allows you to monitor employee work processes, projects, and tasks in real-time.

Get All Work Data

GET https://opl-ai.com/api/wt
Request Body:
JSON
{
  "licenceKey": "YourLicenseKey",
  "opr": "getallworkdata"
}
Response:
JSON
{
  "WorkerTable": [
    {
      "id": "int",
      "company": "string",
      "project": "string",
      "nameSurname": "string",
      "processName": "string",
      "processTitle": "string",
      "startDate": "date",
      "endDate": "date"
    }
  ]
}

Get Work Data by Date Range

GET https://opl-ai.com/api/wt
Request Body:
JSON
{
  "licenceKey": "YourLicenseKey",
  "opr": "getrangeworkdata",
  "startdate": "2024-01-01",
  "enddate": "2024-12-31"
}
Parameters:
Parameter Type Required Description
licenceKey string Required Your API license key
opr string Required Operation type: "getrangeworkdata"
startdate date Required Start date (YYYY-MM-DD)
enddate date Required End date (YYYY-MM-DD)
Response:
JSON
{
  "WorkerTable": [
    {
      "id": "int",
      "company": "string",
      "project": "string",
      "nameSurname": "string",
      "processName": "string",
      "processTitle": "string",
      "startDate": "date",
      "endDate": "date"
    }
  ]
}

Cut Optimizer Module

The Cut Optimizer module minimizes waste by optimizing raw material usage. Create the most efficient cutting plan with different algorithms.

One-Dimensional Cut Optimization

POST https://opl-ai.com/api/optimize1d/opt
Request Body:
JSON
{
  "licenceKey": "YourLicenseKey",
  "selectedAlgorithm": "FFD",
  "kerf": 3.4,
  "fastMode": true,
  "stockList": [
    {
      "length": 1000,
      "count": 1
    },
    {
      "length": 3000,
      "count": 1
    }
  ],
  "piecesList": [
    {
      "length": 1250,
      "count": 1,
      "name": "Left Panel"
    },
    {
      "length": 800,
      "count": 1,
      "name": "Side"
    },
    {
      "length": 2100,
      "count": 1,
      "name": "Cover"
    }
  ]
}
Parameters:
Parameter Type Required Description
licenceKey string Required Your API license key
selectedAlgorithm string Required Algorithm selection: "FFD", "BFD","WOLF" or "CP-SAT"
kerf double Required Operation type: "3.0"
fastMode boolean Required Faster mode selection: true
stockList array Required Raw material list
piecesList array Required Pieces material list
Algorithm Descriptions:
  • FFD (First Fit Decreasing): Fast and efficient, suitable for general use
  • BFD (Best Fit Decreasing): More optimized results, ideal for medium-scale projects
  • CP-SAT (Constraint Programming): Most optimal result, recommended for complex problems
  • WOLF (AI Programming): Recommended for the sharpest results, complex problems and synthesis solutions
Response:
JSON
{
    "success": true,
    "message": "Optimization completed.",
    "data": {
        "report": "Result Description",
        "visuals": [
            {
                "name": "Stock Material 1",
                "length": 1000,
                "parts": [
                    {
                        "length": 800,
                        "width": 80,
                        "isWaste": false,
                        "color": "#65DFA3",
                        "name": "Side"
                    }
                ]
            },
            {
                "name": "Stock Material 2",
                "length": 3000,
                "parts": [
                    {
                        "length": 2100,
                        "width": 70,
                        "isWaste": false,
                        "color": "#2BFA8A",
                        "name": "Cover"
                    }
                ]
            }
        ]
    }
}

Classification Module

The AI-powered classification module automatically categorizes text into predefined categories.

Text Classification

GET https://opl-ai.com/api/cl
Request Body:
JSON
{
  "licenceKey": "YourLicenseKey",
  "opr": "getclassfiy",
  "data": [
    {
      "text": "Text to be classified"
    }
  ]
}
Parameters:
Parameter Type Required Description
licenceKey string Required Your API license key
opr string Required Operation type: "getclassfiy"
data array Required List of texts to be classified
Response:
JSON
{
  "ClassficationTable": [
    {
      "id": "int",
      "text": "string",
      "classfiy": "string"
    }
  ]
}

Error Codes & Management

HTTP Status Codes

Code Description Solution
200 Successful request -
400 Invalid request parameter Check request format and parameters
401 Invalid license key Verify your license key
403 License expired Renew your license
429 Too many requests Reduce request rate
500 Server error Contact support team

Example Error Response

JSON
{
  "result": "E",
  "message": "Licence has expired."
}

Get Started Now!

Optimize your business processes, track locations, and benefit from AI-powered classification services with OPL-AI API.

Get Your API Key