Queries the details of a device.

QPS limits

Each Alibaba Cloud account can run up to 50 queries per second (QPS).

Note The RAM users of an Alibaba Cloud account share the quota of the account.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes QueryDeviceDetail

The operation that you want to perform. Set the value to QueryDeviceDetail.

IotInstanceId String No iot-v64***

The ID of the instance. You can view the ID of the instance on the Overview page in the IoT Platform console.

Notice
  • If your instance has an ID, you must specify the ID for this parameter. Otherwise, the call fails.
  • If no Overview page or ID is generated for your instance, you do not need to configure this parameter.

For more information, see Overview.

ProductKey String No a1BwAGV****

The ProductKey of the product to which the device belongs.

Note If you specify a value for this parameter, you must also specify a value for the DeviceName parameter.
DeviceName String No light

The DeviceName of the device.

Note If you specify a value for this parameter, you must also specify a value for the ProductKey parameter.
IotId String No Q7uOhVRdZRRlDnTLv****00100

The ID of the device.

Note If you specify a value for this parameter, you do not need to specify a value for the ProductKey or DeviceName parameter. The IotId parameter specifies a globally unique identifier (GUID) for the device. The value of the IotId parameter corresponds to a combination of the values of the ProductKey and DeviceName parameters. If you specify a value for the IotId parameter and values for the ProductKey and DeviceName parameters, the value of the IotId takes precedence.

In addition to the preceding operation-specific request parameters, you must specify common request parameters when you call this operation. For more information, see Common request parameters.

Response parameters

Parameter Type Example Description
Code String iot.system.SystemException

The error code returned if the call fails. For more information, see Error codes.

Data Struct

The device details returned if the call is successful.

DeviceName String light

The DeviceName of the device.

DeviceSecret String mz2Canp4GB7qRVf1OYPNtRqB2anu****

The DeviceSecret of the device.

FirmwareVersion String V1.0.0.0

The version number of the default OTA module of the device.

If you want to query the version information about other OTA modules, call the ListOTAModuleVersionsByDevice operation. The version information is submitted by the device.

GmtActive String 2018-08-06 10:48:41

The time when the device was activated. The time is in the GMT format.

GmtCreate String 2018-08-06 10:47:50

The time when the device was created. The time is in the GMT format.

GmtOnline String 2018-08-06 13:43:12

The most recent time when the device was online. The time is in the GMT format.

IotId String Q7uOhVRdZRRlDnTLv****00100

The ID of the device. The ID is the unique identifier that is issued by IoT Platform to the device.

IpAddress String 10.0.0.1

The IP address of the device.

Nickname String detectors_in_beijing

The alias of the device.

NodeType Integer 0

The type of the node. Valid values:

  • 0: device. Sub-devices cannot be attached to a device. A device can connect to IoT Platform directly or as a sub-device of a gateway.
  • 1: gateway. Sub-devices can be attached to a gateway. A gateway can manage sub-devices, maintain the topological relationships with sub-devices, and synchronize the topological relationships to IoT Platform.
Owner Boolean true

Indicates whether the operation is called by the owner of the device.

ProductKey String a1rYuVF****

The ProductKey of the product to which the device belongs.

ProductName String test

The name of the product to which the device belongs.

Region String cn-shanghai

The ID of the region where the device resides. The region is the same as the region where IoT Platform resides. You can view the region in the IoT Platform console.

Status String ONLINE

The device status. Valid values: Valid values:

  • ONLINE: The device is online.
  • OFFLINE: The device is offline.
  • UNACTIVE: The device is not activated.
  • DISABLE: The device is disabled.
UtcActive String 2018-08-06T02:48:41.000Z

The time when the device was activated. The time is in the UTC format.

UtcCreate String 2018-08-06T02:47:50.000Z

The time when the device was created. The time is in the UTC format.

UtcOnline String 2018-08-06T05:43:12.000Z

The most recent time when the device was online. The time is in the UTC format.

ErrorMessage String A system exception occurred.

The error message returned if the call fails.

RequestId String E55E50B7-40EE-4B6B-8BBE-D3ED55CCF565

The ID of the request.

Success Boolean true

Indicates whether the call was successful.

  • true: The call was successful.
  • false: The call failed.

Examples

Sample requests

https://iot.cn-shanghai.aliyuncs.com/?Action=QueryDeviceDetail
&ProductKey=a1rYuVF****
&DeviceName=device1
&<Common request parameters>

Sample success responses

XML format

<QueryDeviceDetailResponse>
  <Data>
        <Owner>true</Owner>
        <GmtActive>2020-01-16 13:33:37</GmtActive>
        <DeviceName>Humidity</DeviceName>
        <ProductKey>a1ttsqu****</ProductKey>
        <DeviceSecret>sLefbFmN9SYfnWLJTePG893XNuRV****</DeviceSecret>
        <IpAddress>42.120.75.144</IpAddress>
        <GmtCreate>2020-01-08 14:47:08</GmtCreate>
        <UtcCreate>2020-01-08T06:47:08.000Z</UtcCreate>
        <IotId>dwnS41bhNxjslDAIF****00100</IotId>
        <Status>OFFLINE</Status>
        <UtcOnline>2020-01-17T08:19:11.091Z</UtcOnline>
        <Region>cn-shanghai</Region>
        <UtcActive>2020-01-16T05:33:37.830Z</UtcActive>
        <Nickname>Temperature and humidity</Nickname>
        <NodeType>0</NodeType>
        <GmtOnline>2020-01-17 16:19:11</GmtOnline>
        <ProductName>Light, temperature, and humidity sensor
  </Data>
  <RequestId>D2D2DE90-DD0F-44EA-9F56-63F07A59F65B</RequestId>
  <Success>true</Success>
</QueryDeviceDetailResponse>

JSON format

{
	"Data": {
		"Owner": true,
		"GmtActive": "2020-01-16 13:33:37",
		"DeviceName": "Humidity",
		"ProductKey": "a1ttsqu****",
		"DeviceSecret": "sLefbFmN9SYfnWLJTePG893XNuRV****",
		"IpAddress": "42.120.75.144",
		"GmtCreate": "2020-01-08 14:47:08",
		"UtcCreate": "2020-01-08T06:47:08.000Z",
		"IotId": "dwnS41bhNxjslDAIF****00100",
		"Status": "OFFLINE",
		"UtcOnline": "2020-01-17T08:19:11.091Z",
		"Region": "cn-shanghai",
		"UtcActive": "2020-01-16T05:33:37.830Z",
		"NickName": "Temperature and humidity",
		"NodeType": 0,
		"GmtOnline": "2020-01-17 16:19:11",
		"ProductName": "Light, temperature, and humidity sensor"
	},
	"RequestId": "D2D2DE90-DD0F-44EA-9F56-63F07A59F65B",
	"Success": true
}