Call this operation to query the details of a specified device.

Request parameters

Parameter Type Required Description
Action String Yes The operation that you want to perform. Set the value to QueryDeviceDetail.
IotId String No

The unique identifier of the device that you want to query.

Note If you use this parameter, ProductKey and DeviceName are not required. IotId is a globally unique identifier (GUID) of a device, and corresponds to a combination of ProductKey and DeviceName. If you specify both IotId and the combination of ProductKey and DeviceName, the system follows IotId.
ProductKey String No

The ProductKey of the device.

Note If you use this parameter, DeviceName is required.
DeviceName String No

The name of the device that you want to query.

Note If you use this parameter, ProductKey is required.
Common Request Parameters - Yes For more information about common request parameters, see Common parameters.

Response parameters

Parameter Type Description
RequestId String The globally unique ID generated by Alibaba Cloud for the request.
Success Boolean Indicates whether the call is successful. A value of true indicates that the call is successful. A value of false indicates that the call has failed.
ErrorMessage String The error message returned when the call fails.
Code String The error code returned when the call fails. For more information about error codes, see Error codes.
Data Data The device details returned when the call is successful. See the following table Data.
Table 1. Data
Parameter Type Description
ProductKey String The ProductKey of the device.
ProductName String The product name of the device.
DeviceName String The device name.
Nickname String The nickname of the device.
DeviceSecret String The device key.
IotId String The GUID issued by IoT Platform to the device.
UtcCreate String The time when the device was created, in UTC.
GmtCreate String The time when the device was created, in GMT.
UtcActive String The time when the device was activated, in UTC.
GmtActive String The time when the device was activated, in GMT.
UtcOnline String The last time when the device went online, in UTC.
GmtOnline String The last time when the device went online, in GMT.
Status String

Device status. Values:

ONLINE: The device is online.

OFFLINE: The device is offline.

UNACTIVE: The device is not activated.

DISABLE: The device is disabled.

FirmwareVersion String The firmware version number of the device.
IpAddress String The IP address of the device.
NodeType Integer

The node type of the device. Values include:

0: Device. A device cannot be mounted with sub-devices. It can connect to IoT Platform either directly or as a sub-device of a gateway.

1: Gateway. A gateway can be mounted with sub-devices. It can manage sub-devices, maintain the topological relationships with sub-devices, and synchronize the topological relationships to IoT Platform.

Region String The region ID of the device (corresponding to the region in the IoT Platform console.

Examples

Request example

https://iot.cn-shanghai.aliyuncs.com/?Action=QueryDeviceDetail
&ProductKey=a1rYuV*****
&DeviceName=SR8FiTu1R9tlUR2V1bmi
&Public Request Parameters

Response example

  • JSON format

    {
      "RequestId":"57b144cf-09fc-4916-a272-a62902d5b207",
      "Success": true,
      "Data": {
        "DeviceName": "SR8FiTu1R9tlUR2V1bmi",
        "GmtActive": "2018-08-06 10:48:41",
        "UtcActive": "2018-08-06T02:48:41.000Z",
        "ProductKey": "a1rYuV*****",
        "DeviceSecret": "CPwUjMUgzdvaZv56TMy6773V3v3****",
        "GmtCreate": "2018-08-06 10:47:50",
        "UtcCreate": "2018-08-06T02:47:50.000Z",
        "IotId": "SR8FiTu1R9tlUR2V1bmi0010*****",
        "Status": "ONLINE",
        "Region": "cn-shanghai",
        "NodeType": 0,
        "GmtOnline": "2018-08-06 13:43:12",
        "UtcOnline": "2018-08-06T05:43:12.000Z",
        "ProductName": "test",
        "IpAddress":"10.0.0.1",
        "FirmwareVersion":"V1.0"
      },
    }
  • XML format

    <? xml version='1.0' encoding='utf-8'? >
    <QueryDeviceDetailResponse>
        <RequestId>57b144cf-09fc-4916-a272-a62902d5b207</RequestId>
        <Success>true</Success>
        <Data>
            <DeviceName>SR8FiTu1R9tlUR2V1bmi</DeviceName>
            <GmtActive>2018-08-06 10:48:41</GmtActve>
    	<UtcActive>2018-08-06T02:48:41.000Z</UtcActive>
            <ProductKey>a1rYuVF****</ProductKey>
            <DeviceSecret>CPwUjMUgzdvaZv56TMy6773V3v3W****</DeviceSecret>
            <GmtCreate>2018-08-06 10:47:50</GmCreate>
    	<UtcCreate>2018-08-06T02:47:50.000Z</UtcCreate>
            <IotId>SR8FiTu1R9tlUR2V1bmi0010a5****</IotId>
            <Status>ONLINE</Status>
            <Region>cn-shanghai</Region>
            <NodeType>0</NodeType>
            <GmtOnline>2018-08-06 13:43:2</GmtOnline>
    	<UtcOnline>2018-08-06T05:43:12.000Z</UtcOnline>
            <ProductName>test</ProductName>
            <IpAddress>10.0.0.1</IpAddress>        
            <FirmwareVersion>V1.0</FirmwareVersion>
        </Data>
    </QueryDeviceDetailResponse>