5.4.2 api switch status
Service and Privileges Groups
Service group is Switch.
Privileges group is Switch Control.
Methods
GET
POST
Request
The request contains parameters in the URL (or in the application/x-www-form-urlencoded format when POST is used).
Parameter Name | Mandatory | Expected Values | Default Value | Description |
---|---|---|---|---|
switch | No | Integer defining a switch (typically 1 to 4) | – | Defines which switch status will be returned. api/switch/caps can be used for obtaining the number of switches of a particular device. The status of switches is returned if this parameter is omitted. |
Example of a Request
URL: https://192.168.1.1/api/switch/status?switch=1
The success response is in the application/json format. It contains two JSON keys success
and result
, which contains the key switches
(status information on individual switches are in an Array of one to four elements).
Key | Typical Returned Values | Description |
---|---|---|
switch | Integer (typically 1 to 4) | Defines to which switch the status is related. |
active |
| Defines the current state of the switch ( |
locked |
| Defines whether the switch is locked or not ( |
held |
| Defines whether the switch is held or not ( |
Example of a Response
{ "success": true, "result": { "switches": [ { "switch": 1, "active": true, "locked": false, "held": true }, { "switch": 2, "active": true, "locked": false, "held": false }, { "switch": 3, "active": false, "locked": true, "held": true }, { "switch": 4, "active": false, "locked": true, "held": false } ] } }
There may occur various errors (e.g. missing mandatory parameter). Errors are returned in .json with a response code 200.