Get Device List

Last Updated on : 2023-06-20 14:54:08download

Get a list of device information based on the specified criteria.

API address

GET: /v1.0/expand/devices

Request parameter

Parameter nameTypeINRequiredDescription
requestDeviceQueryRequestquerytrueThe request object of the device query.

Description of request

Parameter nameTypeINRequiredDescription
project_idString trueThe project ID.
page_noInteger trueThe current page number.
page_sizeInteger trueThe number of entries returned on each page.
product_typeString falseThe category of a specified product.

Return parameter

Parameter nameTypeDescription
resultPageResultThe returned result.

Description of result

Parameter nameTypeDescription
listListThe list of data.
totalLongThe total number of entries.
page_sizeIntegerThe number of entries returned on each page.
page_noIntegerThe current page number.

Description of list

Parameter nameTypeDescription
project_idStringThe project ID.
device_idStringThe device ID.
cidStringThe unique device ID.
gateway_idStringThe gateway ID.
device_nameStringThe device name.
device_ipStringThe IP address of a specified device.
mac_addressStringThe MAC address of a specified device.
product_typeStringThe category of a specified product.
product_idStringThe product ID.
supplier_codeStringThe code of a specified supplier.
install_locationStringThe location where the device is installed.
extend_dataStringThe extended data.
active_statusStringIndicates whether the device is activated. Valid values:
  • 0: The device is not activated.
  • 1: The device is activated.
online_statusStringIndicates whether a device is online. Valid values:
  • 0: The device is offline.
  • 1: The device is online.
create_timeLongThe time when the device is created.
product_nameStringThe product name.
supplier_nameStringThe name of a specified supplier.
task_idStringThe ID of a specified construction task.

Request example

GET: /v1.0/expand/devices?projectId=123****&pageNo=1&pageSize=20

Return example

{
    "result": {
        "page_no": 1,
        "list": [
            {
                "device_id": "6ce****",
                "create_time": 1591693362843,
                "online_status": 1,
                "gateway_id": "6c2****",
                "install_location": "The east entrance of the community",
                "device_ip": "192.***.16.111",
                "uid": "ay1534****",
                "device_name": "Access control at the east entrance of the community",
                "product_type": "wf_znmj",
                "extend_data": "{'pass':'123456','ip':'192.***.2.160','url':'http://192.***.2.160:8090'}",
                "active_status": 1,
                "project_id": "1356****",
                "mac_address": "00-55-52-**-**-**",
                "product_id": "0vbr****",
                "supplier_code": "tuya",
                "cid": "1207****"
            }
        ],
        "total": 100,
        "page_size": 20
    },
    "t": 1551851043862,
    "success": true
}

Error code

For more information, see error code.