Query a Specific Device

Query the detailed information of a specific device.

Request URL

GET {base_url}/device/openapi/v1/devices/{deviceId}

Request Parameters

Table 1. Header Parameters
Parameter Required Type Description
Authorization Yes String The valid access token for making API calls.

The format should be Bearer {access_token}.

Table 2. Path Parameters
Parameter Required Type Description
deviceId Yes Long The unique ID of this device, which is returned when you add the device.
Note: If you did NOT save the deviceID, you can query the device's ID using Search Specific Devices.

Response Parameters

Parameter Type Description
data Object<Device_Info> Detailed information of the queried device.
status String The result of the API request.
  • Success
  • Failed
requestId String The unique ID of the request, which can be used to quickly locate the request.
Device_Info
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
Query the detailed information of the device with ID "1739930666380779522"
GET /device/openapi/v1/devices/1739930666380779522 HTTP/1.1
Host: demo.milesight.com
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InllYXN0b25lLWRlZmF1bHQta2V5LWlkIn0.eyJncmFudF90eXBlIjoiY2xpZW50X2NyZWRlbnRpYWxzIiwic2NvcGUiOlsib3BlbmFwaSJdLCJjbGllbnRfZXh0Ijp7ImFwcF9pZCI6IjE3MzY5NTQ4MDE3MTMzMjgxMzAifSwiZXhwIjoxNzAzMjEzMDk4LCJhdXRob3JpdGllcyI6WyJST0xFX0NMSUVOVCJdLCJqdGkiOiJiYjJjN2U4Yy03NGQwLTQ4NjEtODE3MS1iYTc0NWRlMGY0NmQiLCJjbGllbnRfaWQiOiI4OTNkNzdjNy1mMGNiLTRmMzQtOWNhMS03YzJhNGNmMTEzNDgiLCJ0cyI6MTcwMzIwOTQ5ODMzNH0
Content-Type: application/json
Response example
HTTP/1.1 200 OK
{
    "data": {
        "sn": "6791D1970467xxxx",
        "autopStatus": "DISABLE",
        "name": "Demo Device",
        "model": "WS203",
        "hardwareVersion": "v1.0",
        "firmwareVersion": "v1.1",
        "electricity": 97,
        "lastUpdateTime": 1704172785337,
        "application": {
            "applicationId": "1734475086466600962",
            "applicationName": "Demo"
        },
        "project": "Demo",
        "description": "Demo",
        "deviceId": "1739930666380779522",
        "devEUI": "24E124791D1xxxx",
        "connectStatus": "ONLINE"
    },
    "status": "Success",
    "requestId": "c15d037ea4c74565ecced1725c8d46d6"
}