Query Device Capability Status

Last Updated on : 2022-11-11 03:43:50

Query all capabilities of the specified device. You can also precisely filter the capabilities based on capability_code and channels.

API address

GET: /v1.0/iot-03/devices/{device_id}/capabilities

Request parameter

Parameter nameTypeINRequiredDescription
device_idStringuritrueThe device ID.
capability_codeStringqueryfalseThe code of a specified capability.
channelsStringqueryfalseThe list of channels, applicable to multi-channel products, such as a power strip.

Return parameter

Parameter nameTypeDescription
resultObjectThe returned result. The structure is Map, the key is the capability code, and the value is the status value set of the capabilities. For example: { "switch":[ { "channel":"1", "value":false } ]}

Request example

GET: /v1.0/iot-03/devices/64***dz/capabilities?capability_code=switch

Return example

{
    "result": {
        "countdown": [//Capability code
            {
                "channel": "9",
                "value": 0
            }
        ],
        "relay_status": [//Capability code
            {
                "channel": "38",
                "value": "power_off"
            }
        ],
        "switch": [//Capability code
            {
                "channel": "1",
                "value": false
            }
        ]
    },
    "success": true,
    "t": 1668069255415,
    "tid": "75c83d6b60d211ed8b2566906d2287eb"
}

Error code

For more information, see error code.