5.5.3 api io ctrl
The /api/io/ctrl function controls the statuses of the device logic outputs. The function has two mandatory parameters: port, which determines the output to be controlled, and action, defining the action to be executed over the output (activation, deactivation).
The function is part of the I/O service and the user must be assigned the I/O Control privilege for authentication if required.
The GET or POST method can be used for this function.
Request parameters:
Parameter | Description |
---|---|
port | Mandatory I/O identifier. Use also /api/io/caps to get the identifiers of the available inputs and outputs. |
action | Mandatory action defining parameter (on – activate output, log. 1, off – deactivate output, log. 0) |
response | Optional parameter modifying the intercom response to include the text defined here instead of the JSON message. |
The reply is in the application/json format and includes no parameters.
Example:
GET /api/io/ctrl?port=relay1&action=on { "success" : true }
If the response parameter is used, the reply does not include the json messages; the server returns a text/plain reply with the specified text (which can be empty).
Example:
GET /api/io/ctrl?port=relay1&action=on&response=text text
GET /api/io/ctrl?port=relay1&action=on&response=