Queries the details of multiple devices under a product.

Limits

  • You can query a maximum of 100 devices in a single call.
  • You can query the details of devices that belong only to the current Alibaba Cloud account. If you specify a device that does not belong to the current account, an error message is returned.
  • If you specify multiple devices and some devices do not exist, only the details of existing devices are returned.
  • Each Alibaba Cloud account can run a maximum of 5 queries per second (QPS).
    Note 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 a sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes BatchQueryDeviceDetail

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

DeviceName.N RepeatList Yes light

The names of devices. You can specify a maximum of 100 device names.

Note The specified devices must belong to the same product.
ProductKey String Yes a1BwAGV****

The ProductKey of the product to which the devices specified by the DeviceName.N parameter belong.

IotInstanceId String No iot_instc_pu****_c*-v64********

The ID of the instance.

You do not need to specify this parameter.

In addition to the preceding operation-specific request parameters, you must specify common request parameters when you call this operation. For more information about common request parameters, see Common 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 Array of Data

The device details returned if the call is successful.

Data
DeviceName String light

The DeviceName of the device.

DeviceSecret String mz2Canp4GB7qRVf1OYPNtRqB2anu****

The DeviceSecret of the device.

FirmwareVersion String V1.0.0.0

The firmware version number of the device.

GmtActive String 2019-06-21 20:33:00

The activation time of the device. The time is in the GMT format.

GmtCreate String 2019-06-21 20:31:42

The creation time of the device. The time is in the GMT format.

IotId String Q7uOhVRdZRRlDnTLv****00100

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

Nickname String Smart street light

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.
ProductKey String a1BwAGV****

The ProductKey of the product to which the device belongs.

ProductName String Street light

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 status of the device. 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 2019-06-21T12:31:42.000Z

The activation time of the device. The time is in the UTC format.

UtcCreate String 2019-06-21T12:31:42.000Z

The creation time of the device. 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=BatchQueryDeviceDetail
&ProductKey=a1fce6J****
&DeviceName.1=firstDeviceName
&DeviceName.2=secondDeviceName
&<Common request parameters>

Sample success responses

XML format

<BatchQueryDeviceDetailResponse>
  <Data>
        <Data>
              <DeviceName>Humidity</DeviceName>
              <GmtActive>2020-01-16 13:33:37</GmtActive>
              <ProductKey>a1ttsqu****</ProductKey>
              <DeviceSecret>sLefbFmN9SYfnWLJTePG893XNuRV****</DeviceSecret>
              <GmtCreate>2020-01-08 14:47:08</GmtCreate>
              <UtcCreate>2020-01-08T06:47:08.000Z</UtcCreate>
              <IotId>dwnS41bhNxjslDAIF****00100</IotId>
              <Status>OFFLINE</Status>
              <UtcActive>2020-01-08T06:47:08.000Z</UtcActive>
              <Region>cn-shanghai</Region>
              <NickName>Temperature and humidity</NickName>
              <NodeType>0</NodeType>
              <ProductName>Light, temperature, and humidity sensor</ProductName>
        </Data>
        <Data>
              <Status>OFFLINE</Status>
              <GmtActive>2020-01-17 16:23:15</GmtActive>
              <DeviceName>TH_sensor</DeviceName>
              <Region>cn-shanghai</Region>
              <UtcActive>2020-01-17T03:39:14.000Z</UtcActive>
              <ProductKey>a1ttsqu****</ProductKey>
              <NodeType>0</NodeType>
              <DeviceSecret>dCYdTU3gw5Z77bsHjPk6lPHPVnBT****</DeviceSecret>
              <ProductName>Light, temperature, and humidity sensor</ProductName>
              <GmtCreate>2020-01-17 11:39:14</GmtCreate>
              <UtcCreate>2020-01-17T03:39:14.000Z</UtcCreate>
              <IotId>RKYkCRstfGBh5SZXL****00100</IotId>
        </Data>
  </Data>
  <RequestId>D4C12DD8-4390-4877-B1DC-4049CF4868BC</RequestId>
  <Success>true</Success>
</BatchQueryDeviceDetailResponse>

JSON format

{
	"Data": {
		"Data": [
			{
				"DeviceName": "Humidity",
				"GmtActive": "2020-01-16 13:33:37",
				"ProductKey": "a1ttsqu****",
				"DeviceSecret": "sLefbFmN9SYfnWLJTePG893XNuRV****",
				"GmtCreate": "2020-01-08 14:47:08",
				"UtcCreate": "2020-01-08T06:47:08.000Z",
				"IotId": "dwnS41bhNxjslDAIF****00100",
				"Status": "OFFLINE",
				"UtcActive": "2020-01-08T06:47:08.000Z",
				"Region": "cn-shanghai",
				"Nickname": "Temperature and humidity",
				"NodeType": 0,
				"ProductName": "Light, temperature, and humidity sensor"
			},
			{
				"Status": "OFFLINE",
				"GmtActive": "2020-01-17 16:23:15",
				"DeviceName": "TH_sensor",
				"Region": "cn-shanghai",
				"UtcActive": "2020-01-17T03:39:14.000Z",
				"ProductKey": "a1ttsqu****",
				"NodeType": 0,
				"DeviceSecret": "dCYdTU3gw5Z77bsHjPk6lPHPVnBT****",
				"ProductName": "Light, temperature, and humidity sensor",
				"GmtCreate": "2020-01-17 11:39:14",
				"UtcCreate": "2020-01-17T03:39:14.000Z",
				"IotId": "RKYkCRstfGBh5SZXL****00100"
			}
		]
	},
	"RequestId": "D4C12DD8-4390-4877-B1DC-4049CF4868BC",
	"Success": true
}

Error codes

For a list of error codes, visit the API Error Center.