5.5.2 api io status

The /api/io/status function returns the current statuses of logic inputs and outputs (ports) of the device. Define the input/output in the optional port parameter. If the port parameter is not included, statuses of all the inputs and outputs are returned.

The function is part of the I/O service and the user must be assigned the I/O Monitoring privilege for authentication if required.

The GET or POST method can be used for this function.

Request parameters:

Parameter

Description

port

Optional input/output identifier. Use also /api/io/caps to get identifiers of the available inputs and outputs.

The reply is in the application/json format and includes a port list (ports) including current settings (state). If the port parameter is used, the ports field includes just one item.

Example:

GET /api/io/status
{
  "success" : true,
  "result" : {
    "ports" : [
      {
        "port" : "relay1",
        "state" : 0
      },
      {
        "port" : "relay2",
        "state" : 0
      }
    ]
  }
}