You can call this operation to query details of multiple devices at a time.

Limits

  • You can query only details of devices that belong to the current Alibaba Cloud account. If a device that does not belong to the current account is contained in the request, an error is returned.
  • If a device that does not exist is contained in the request, only details of existing devices are returned.
  • The QPS of this operation is limited to 5 for a single account.
  • A maximum of 100 devices can be queried in a single call.

Request parameters

Parameter Type Required Description
Action String Yes The operation that you want to perform. Set this parameter to BatchQueryDeviceDetail.
ProductKey String Yes

The ProductKey of the product to which the devices that you want to query belong.

DeviceName List<String> Yes

The list of the names of the devices that you want to query. The list can contain up to 100 device names.

Common request parameters - Yes For more information about common request parameters, see Common parameters.

Response parameters

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

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.

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

The node type of the device. Valid values:

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 topology with sub-devices, and synchronize the topology to IoT Platform.

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

Examples

Sample request

https://iot.cn-shanghai.aliyuncs.com/?Action=BatchQueryDeviceDetail
&ProductKey=a1fce6J****
&DeviceName.1=firstDeviceName
&DeviceName.2=secondDeviceName
&Common request parameters

Sample response

  • JSON format
    {
      "RequestId": "57b144cf-09fc-4916-a272-a62902d5b787", 
      "Success": true, 
      "Data":[
        {
          "DeviceName": "firstDeviceName",
          "DeviceSecret": "m2gIah1iCkIHXqVJdBVM****",
          "FirmwareVersion": "v1.0.0",
          "GmtCreate": "2019-06-21 20:31:42",
          "GmtActive": "2019-06-21 20:33:00",
          "IotId": "M7aUr3JmdsJ1KQolwI3l00****",
          "Nickname": "TestDevice1",
          "NodeType": 0,
          "ProductKey": "a1fce6J****",
          "ProductName": "testProduct2b2ea8",
          "Region": "cn-shanghai",
          "Status": "ONLINE",
          "UtcCreate": "2019-06-21T12:31:42.000Z",
          "UtcActive": "2019-06-21T12:33:00.000Z",
        },
        {
          "DeviceName": "secondDeviceName",
          "DeviceSecret": "i7nIah1iCkIHXqVJdBVM****",
          "GmtCreate": "2019-06-21 20:31:42",
          "IotId": "ioUyd3JmdsJ1KQolwI3l00****",
          "NodeType": 0,
          "ProductKey": "a1fce6J****",
          "ProductName": "testProduct2b2ea8",
          "Region": "cn-shanghai",
          "Status": "UNACTIVE",
          "UtcCreate": "2019-06-21T12:31:42.000Z"
        }
      ]
    }        
  • XML format
    <?xml version="1.0" encoding="UTF-8" ?>
    <BatchQueryDeviceDetailResponse>
        <RequestId>57b144cf-09fc-4916-a272-a62902d5b787</RequestId>
        <Success>true</Success>
        <Data>
            <DeviceName>firstDeviceName</DeviceName>
            <DeviceSecret>m2gIah1iCkIHXqVJdBVM****</DeviceSecret>
            <FirmwareVersion>v1.0.0</FirmwareVersion>
            <GmtCreate>2019-06-21 20:31:42</GmtCreate>
            <GmtActive>2019-06-21 20:33:00</GmtActive>
            <IotId>M7aUr3JmdsJ1KQolwI3l00****</IotId>
            <Nickname>TestDevice1</Nickname>
            <NodeType>0</NodeType>
            <ProductKey>a1fce6J****</ProductKey>
            <ProductName>testProduct2b2ea8</ProductName>
            <Region>cn-shanghai</Region>
            <Status>ONLINE</Status>
            <UtcCreate>2019-06-21T12:31:42.000Z</UtcCreate>
            <UtcActive>2019-06-21T12:33:00.000Z</UtcActive>
        </Data>
        <Data>
            <DeviceName>secondDeviceName</DeviceName>
            <DeviceSecret>i7nIah1iCkIHXqVJdBVM****</DeviceSecret>
            <GmtCreate>2019-06-21 20:31:42</GmtCreate>
            <IotId>ioUyd3JmdsJ1KQolwI3l00****</IotId>
            <NodeType>0</NodeType>
            <ProductKey>a1fce6J****</ProductKey>
            <ProductName>testProduct2b2ea8</ProductName>
            <Region>cn-shanghai</Region>
            <Status>UNACTIVE</Status>
            <UtcCreate>2019-06-21T12:31:42.000Z</UtcCreate>
        </Data>
    </BatchQueryDeviceDetailResponse>