Telegram chatbot Contact



















API REST Micra MAX

Especifications

29 de Junio del 2023


Introduction

API Purpose
The purpose of this API is to provide a REST application programming interface (API) to facilitate communication and data exchange between different systems. This API has been developed with the objective of allowing developers to access and manipulate certain resources and specific functionalities of our system or application in an efficient and secure manner.

Using this API, developers will be able to integrate and use our functionalities in their own applications, thus taking advantage of the capacity and data of our system in a flexible and personalized way. Additionally, by following REST design principles, our API adheres to widely accepted standards, making it easy to adopt and deploy across diverse environments and platforms.

By providing a REST API, our goal is to encourage the creation of applications and services that can effectively interact with our system. This opens new opportunities for collaboration, innovation and the creation of solutions that improve the user experience and provide greater added value through the integration of our functionalities.

Throughout this documentation, you will find detailed information about available endpoints, request parameters, response formats, required authentication, and recommended best practices to use our API effectively. We hope this documentation is a useful guide so developers can take full advantage of the capabilities of our API and build powerful and innovative applications.


Goals and Use Cases

Provide developers with a standardized interface to access and use data generated by probes and sensors connected to Micra MAX.

Facilitate the integration of Micra MAX into existing applications and systems, allowing the exchange of information in real time.

Improve visualization efficiency in capturing, analyzing and displaying data collected by Micra MAX.

Drive innovation by enabling developers to create custom solutions based on information provided by Micra MAX.


Use cases

Process Monitoring and Control: The API allows developers to obtain real-time data from the probes and sensors connected to Micra MAX, which facilitates the monitoring and control of industrial processes, such as temperature, humidity, pressure, among other critical parameters. .

Integration into Asset Management Platforms: Data from Micra MAX can be used in asset management platforms, allowing users to monitor and manage equipment and systems in real time. For example, the API can be used to receive automatic alerts in case a sensor connected to Micra MAX indicates a problem or a value outside the established limits.

Data Analysis and Report Generation: The API makes it easy to extract data stored in Micra MAX, allowing developers to perform advanced analysis and generate custom reports. For example, sensor data can be used to identify patterns, trends and anomalies, which can be useful in predictive equipment maintenance or process optimization.

These are just a few examples of the goals and use cases that the Micra MAX Connection API can address. By providing an easy-to-use and flexible interface, our API allows developers to take full advantage of the data generated by Micra MAX, opening up a world of possibilities for creating customized solutions and improving efficiency across various sectors and applications.


Authorization

Authorization to access the API is done through a Token, which must be included in the request header with the name "X-DTpanel".

The Token or password necessary for authorization is defined within the Micra MAX device webserver.

Importantly, the user has the ability to modify this Token, providing flexibility and control over the security of requests made to the hardware.

To ensure effective and secure communication, it is recommended to generate and use a strong and unique Token.


Communication

Communication with the Micra MAX API is done through JSON (JavaScript Object Notation) objects.

Both requests sent and responses received must be in JSON + UTF-8 format to ensure compatibility and ease of data processing.


Application Methods

The main commands used in the Micra MAX API are:

GET Used to obtain specific information or data from the probes and sensors connected to Micra MAX.

POST Used to send information or perform specific actions on the Micra MAX hardware.

DELETE Used to delete or deactivate resources or configurations in Micra MAX.


Quick Start Guide

Examples with cURL:

curl -X GET "192.168.1.208/v1/hello.json" -H "X-DTpanel: token"

Header Response: 200

json response: [{"id": 1,"status":"Hello World"}]


Error Codes or Response

200: Success

201: Success Creation.

400: Invalid request

401: Unauthorized

404: Resource not found


Endpoints


/v1/get_display

Receive information from the display (GET)

curl -X GET "IP/v1/get_display" -H "X-DTpanel: token"


//Response                  
{
    "bigDisplayValue": "33.82",
    "minimumValue": "-120.26",
    "maximumValue": "388.04",
    "setPoint1": "35.00",
    "setPoint2": "20.00",
    "setPoint3": "30.00",
    "setPoint4": "40.00"
}                

/v1/reset_tare

Reset tare (POST)

curl -X POST "IP/v1/reset_tare" -H "X-DTpanel: token"


//Response                  
{
    "response message":     "reset_tare recibido"
}                

/v1/reset_max

Reset Max (POST)

curl -X POST "IP/v1/reset_max" -H "X-DTpanel: token"


//Response                  
{
    "response message":     "reset_max recibido"
}               

/v1/reset_min

Reset Min (POST)

curl -X POST "IP/v1/reset_min" -H "X-DTpanel: token"


//Response                  
{
    "response message":     "reset_min recibido"
}               

/v1/tare

Tare (POST)

curl -X POST "IP/v1/tare" -H "X-DTpanel: token"


//Response                  
{
    "response message":     "tare recibido"
}               

/v1/factory_reset

Factory Reset (POST)

curl -X POST "IP/v1/factory_reset" -H "X-DTpanel: token"


//Response                  
{
    "response message":     "factory_reset recibido"
}               

/v1/get_info

Obtener información del equipo (GET)

curl -X GET "IP/v1/get_info" -H "X-DTpanel: token"


//Response                  
{
    "modelName":    "MICRA-M MAX",
    "serialNumber": "DT-KOSMOS-0001",
    "dateManufact": "10-09-2023",
    "softwareVersion":      "206",
    "optionsInstalled":     
    {
        "option1":      "",
        "option2":      "",
        "option3":      ""
    }
}

/v1/get_config

Receive a configuration to the device (GET)

curl -X GET "IP/v1/config" -H "X-DTpanel: token"


//Response                  
{
  "inputType": {
    "processInputType": {
      "processInputTypeValues": "10V"
    },
    "loadCellInputType": null,
    "thermometerInputType": null
  },
  "display": {
    "optionsOfDisplayConfig": {
      "decimalsDisplay": 3,
      "linearisationPoints": 2,
      "roundingFilter": "01",
      "balancedFilter": 0
    },
    "values": [
      {
        "inputValue": 0,
        "displayValue": 0
      },
      {
        "inputValue": 1,
        "displayValue": 1
      }
    ],
    "displayInputError": "off",
    "displayEco": {
      "ecoState": "off",
      "ecoValue": 10
    },
    "brightType": "high",
    "tareValue": 1,
    "runModeColor": "green",
    "progModeColor": "orange"
  },
  "setPoints": [
    {
      "onOffType": "on",
      "value": 1,
      "comparisonValue": "net",
      "actionMode": "high",
      "noNcType": "no",
      "colorAlarmType": "noChange",
      "activationType": "hysteresis",
      "activationValue": 0
    },
    {
      "onOffType": "on",
      "value": 2,
      "comparisonValue": "net",
      "actionMode": "high",
      "noNcType": "no",
      "colorAlarmType": "noChange",
      "activationType": "hysteresis",
      "activationValue": 0
    },
    {
      "onOffType": "on",
      "value": 3,
      "comparisonValue": "net",
      "actionMode": "high",
      "noNcType": "no",
      "colorAlarmType": "noChange",
      "activationType": "hysteresis",
      "activationValue": 0
    },
    {
      "onOffType": "on",
      "value": 4,
      "comparisonValue": "net",
      "actionMode": "high",
      "noNcType": "no",
      "colorAlarmType": "noChange",
      "activationType": "hysteresis",
      "activationValue": 0
    }
  ],
  "rssConfig": null,
  "communications": {
    "APIPassword": "4X6XXX65XX31",
    "ethernet": {
      "ipAddress": "10.0.0.140",
      "gateWay": "10.0.0.50",
      "dns1": "8.8.8.8",
      "dns2": "8.8.4.4"
    },
    "mqtt": {
      "onOffState": 0,
      "deviceFamily": "micra",
      "server": "",
      "port": 1883,
      "user": "",
      "password": ""
    }
  },
  "bluetooth": {
    "deviceName": "MICRA-0002"
  },
  "analogueConfig": {
    "displayHigh": 10,
    "displayLow": 0,
    "overrange": "high"
  },
  "logicFunctionConfig": {
    "pin2": 1,
    "pin3": 2,
    "pin4": 18
  },
  "programmingLockCodeConfig": {
    "code": "0000",
    "lkSetPoints1": false,
    "lkSetPoints2": false,
    "lkSetPoints3": false,
    "lkSetPoints4": false,
    "lkInput": false,
    "lkDisplay": false,
    "lkFilterP": false,
    "lkDirectSetpoints": false,
    "lkRsOutput": false,
    "lkLogic": false,
    "lkAnalogue": false,
    "lkBrightness": false,
    "lkTareKey": false,
    "lkMaxMin": false
  },
  "userEmail": "",
  "sysUser": "admin",
  "sysPassword": "admin",
  "apiPassword": "446974656C31",
  "deviceInfo": {
    "modelName": "MICRA-M MAX",
    "serialNumber": "DT-KOSMOS-0001",
    "dateManufact": "10-09-2023",
    "softwareVersion": "206",
    "option1": "",
    "option2": "",
    "option3": ""
  }
}

/v1/post_config

Send a configuration to the device (POST)

curl -X POST "IP/v1/config" -H "X-DTpanel: token" -H "Content-type: application/json" -d @request_body

Where @request_body = json with the configuration parameters


{
  "inputType": {
    "processInputType": null,
    "loadCellInputType": {
      "loadCellInputTypeValues": "150mv"
    },
    "thermometerInputType": null
  },
  "display": {
    "optionsOfDisplayConfig": {
      "decimalsDisplay": 2,
      "linearisationPoints": 11,
      "roundingFilter": "01",
      "balancedFilter": 1
    },
    "values": [
      {
        "inputValue": 0,
        "displayValue": 0
      },
      {
        "inputValue": 0,
        "displayValue": 0
      },
      {
        "inputValue": 0,
        "displayValue": 0
      },
      {
        "inputValue": 0,
        "displayValue": 0
      },
      {
        "inputValue": 0,
        "displayValue": 0
      },
      {
        "inputValue": 0,
        "displayValue": 0
      },
      {
        "inputValue": 0,
        "displayValue": 0
      },
      {
        "inputValue": 0,
        "displayValue": 0
      },
      {
        "inputValue": 0,
        "displayValue": 0
      },
      {
        "inputValue": 0,
        "displayValue": 0
      },
      {
        "inputValue": 0,
        "displayValue": 0
      }
    ],
    "displayInputError": "off",
    "displayEco": {
      "ecoState": "off",
      "ecoValue": 0
    },
    "brightType": "high",
    "tareValue": 1,
    "runModeColor": "green",
    "progModeColor": "orange"
  },
  "setPoints": [
    {
      "onOffType": "off",
      "value": 0,
      "comparisonValue": "net",
      "actionMode": "high",
      "noNcType": "no",
      "colorAlarmType": "noChange",
      "activationType": "delay",
      "activationValue": 0
    },
    {
      "onOffType": "off",
      "value": 0,
      "comparisonValue": "net",
      "actionMode": "high",
      "noNcType": "no",
      "colorAlarmType": "noChange",
      "activationType": "delay",
      "activationValue": 0
    },
    {
      "onOffType": "off",
      "value": 0,
      "comparisonValue": "net",
      "actionMode": "high",
      "noNcType": "no",
      "colorAlarmType": "noChange",
      "activationType": "delay",
      "activationValue": 0
    },
    {
      "onOffType": "off",
      "value": 0,
      "comparisonValue": "net",
      "actionMode": "high",
      "noNcType": "no",
      "colorAlarmType": "noChange",
      "activationType": "delay",
      "activationValue": 0
    }
  ],
  "rssConfig": {
    "bauds": 9600,
    "id": 1,
    "protocol": "ascii",
    "replyDelay": "no_delay"
  },
  "ipAddress": null,
  "analogueConfig": {
    "displayHigh": 0,
    "displayLow": 0,
    "overrange": "high"
  },
  "logicFunctionConfig": {
    "pin2": 1,
    "pin3": 2,
    "pin4": 6
  },
  "programmingLockCodeConfig": {
    "code": 0,
    "lkSetPoints1": false,
    "lkSetPoints2": false,
    "lkSetPoints3": false,
    "lkSetPoints4": false,
    "input": false,
    "display": false,
    "analogueOutput": false,
    "rsOutput": false,
    "logicFunctions": false,
    "tareKey": false,
    "directSetpoints": false,
    "brightnessColor": false,
    "filterP": false,
    "maxMin": false
  }
}