Search Specific Devices
Search specific devices from all the devices that are associated with the current Application.
Request URL
POST {base_url}/device/openapi/v1/devices/search
Request Parameters
Parameter | Required | Type | Description |
---|---|---|---|
Authorization | Yes | String | The valid access token for making API calls. The format should be Bearer {access_token}. |
Parameter | Required | Type | Description | |
---|---|---|---|---|
pageSize | Yes | Integer | Define how many records per page. | |
pageNumber | Yes | Integer |
Define which page is displayed. |
|
sorts | No | Array<Object> | Define the sorting field and display order. | |
direction | No | String | Define the display order. Valid value:
|
|
property | No | String | Define the sorting field. Valid value: Existing fields of the device details. |
|
sn | No | String | Specify the devices' SN (Serial Number) to search for. | |
devEUI | No | String | Specify the devices' EUI (Extended Unique Identifier) to search for. | |
imei | No | String | Specify the devices' IMEI (International Mobile Equipment Identity) to search for. | |
autopStatus | No | Array<String> | Specify the devices' auto provisioning status to search
for. Valid value:
|
|
connectStatus | No | Array<String> | Specify the devices' connectivity status to search
for. Valid value:
|
|
name | No | String | Specify the device name to search for. | |
model | No | String | Specify the device model to search for. | |
hardwareVersion | No | String | Specify the hardware version of the device to search for. | |
firmwareVersion | No | String | Specify the firmware version of the device to search for. | |
electricityMin | No | Integer | Specify the minimum battery level to search for. For example,
if you set this parameter to |
|
electricityMax | No | Integer | Specify the maximum battery level to search for. For example,
if you set this parameter to 5 , then devices
with less than 5% battery will be displayed.Tip: You can set a low battery
threshold, then use this parameter to filter out devices
with low battery levels. |
|
project | No | String | Specify the device's project tag to search for. | |
description | No | String | Specify the device description to search for. | |
tag | No | Array<String> | Specify the device's tags to search for. | |
deviceType | No | Array<String> | Specify the device's types to search for. Valid value:
|
|
licenseStatus | No | Array<String> | Specify the device's license status to search for. Valid value:
|
Response Parameters
Parameter | Type | Description |
---|---|---|
data | Object<Search_Result> | The search result. |
status | String | The result of the API request.
|
requestId | String | The unique ID of the request, which can be used to quickly locate the request. |
- Search_Result
-
Parameter Type Description pageSize Integer The number of records displayed on each page. pageNumber Integer Which page is displayed. total Integer The total number of records. content Array<Device_Details> Details of devices that match the search criteria. - Device_Details
-
Parameter Type Description sn String The SN (Serial Number) of this device. imei String The IMEI (International Mobile Equipment Identity) of this device. autopStatus String The auto provisioning status of the device. SUCCESS
: The device has been auto-provisioned successfully.WAITING
: The device is waiting to be auto-provisioned.DISABLE
: Auto provisioning is disabled for this device.
name String The device name. model String The device model. hardwareVersion String The hardware version of the device. firmwareVersion String The firmware version of the device. electricity Integer The battery level of the device. lastUpdateTime Long The timestamp of the device's most recent report. application Object Information of the device's associated Application. applicationId Long The unique ID of this Application. applicationName String Name of this Application. project String The device's project tag. description String The device description. deviceId Long The unique ID of this device. devEUI String The EUI (Extended Unique Identifier) of this device. connectStatus String The connectivity status of the device. ONLINE
: The device is actively connected to Milesight Development Platform.OFFLINE
: The device is NOT currently connected to Milesight Development Platform.DISCONNECT
: The device is disconnected from Milesight Development Platform.
licenseStatus String The license status of the device. VALID
: The device can be used.INVALID
: The device is banned after the pro plan expires.
deviceType String The type of this device. GATEWAY
: The gateway device to set up communication between sub devices and Milesight Development Platform.SUB_DEVICE
: The Internet inaccessible device which needs gateway to connect to Milesight Development Platform.COMMON
: The Internet accessible device which is able to connect to Milesight Development Platform directly.
tag Array<String> The tags of this device.
Examples
- Request example
- Search for devices with the auto-provision status disabled.
- Response example
-
HTTP/1.1 200 OK { "data": { "pageSize": 2, "pageNumber": 1, "total": 2, "content": [ { "sn": "6785C3807364xxxx", "autopStatus": "DISABLE", "name": "Comfort Sensor Room-3D", "model": "AM308", "application": { "applicationId": "1734475086466600962", "applicationName": "Demo" }, "project": "Workplace", "description": "Comfort Sensor of Room-3D", "deviceId": "1742010610312101890", "devEUI": "24E124785C38xxxx", "connectStatus": "DISCONNECT" }, { "sn": "6791D1970467xxxx", "autopStatus": "DISABLE", "name": "Demo Device", "model": "TH-Motion Sensor", "hardwareVersion": "v1.0", "firmwareVersion": "v1.1", "electricity": 97, "lastUpdateTime": 1704180118083, "application": { "applicationId": "1734475086466600962", "applicationName": "Demo" }, "project": "Workspace", "description": "TH-Motion Sensor of Room 4A", "deviceId": "1739930666380779522", "devEUI": "24E124791D19xxxx", "connectStatus": "ONLINE" } ] }, "status": "Success", "requestId": "63abfe424fa8c7d273e36d74d87b56b0" }