Get the List of Sub-devices Newly Connected to the Gateway

Last Updated on : 2023-06-20 15:21:07download

Get the list of sub-devices that are newly connected to the gateway.

API address

GET: /v1.0/iot-03/device-registration/devices/{device_id}/sub-devices

Request parameter

Parameter nameTypeINRequiredDescription
device_idStringuritrueThe ID of the gateway device.
discovery_timeLonguritrueThe time when the gateway discovered the sub-device, which is accurate to seconds.

Return parameter

Parameter nameTypeDescription
resultList

Description of result

Parameter nameTypeDescription
idStringThe device ID.
nameStringThe device name.
onlineBooleanThe online status of the device.
active_timeLongThe time when the device was activated.
update_timeLongThe time when the device status was updated.
product_idStringThe product ID of the device.
categoryStringCategory
node_idStringThe nodeId of the sub-device.
asset_idStringThe asset ID.
iconStringThe device icon.

Request example

GET: /v1.0/iot-03/device-registration/devices/xxxid/sub-devices?discovery_time=1566973348

Return example

{
    "result": [
        {
            "asset_id": "******",
            "active_time": 1566973357,
            "update_time": 1566973363,
            "product_id": "tob46aoq******",
            "name": "Smoke detector",
            "online": true,
            "id": "xxxxx",
            "category": "ywbj"
        }
    ],
    "t": 1591872112140,
    "success": true
}

Error code

For more information, see error code.