All Products
Search
Document Center

IoT Platform:BatchCheckImportDevice

更新時間:Dec 12, 2023

Verifies multiple devices that are added to a Standard Enterprise Edition instance or an MQTT cloud gateway product at a time.

QPS limits

You can call this operation up to 100 times per second per account.

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

Details

Action String Yes BatchCheckImportDevice

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

ProductKey String Yes a1BwAGV****

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

DeviceList.N.DeviceName String Yes light

The DeviceName of the device.

The DeviceName must be 4 to 32 characters in length, and can contain letters, digits, hyphens (-), underscores (_), at signs (@), periods (.), and colons (:).

The DeviceName must be unique in the product.

Note You can specify up to 10,000 DeviceNames in a single call. If the number of DeviceNames exceeds the limit, excess DeviceNames are discarded.
DeviceList.N.DeviceSecret String Yes b4d43f7******10ba5e5

The DeviceSecret of the device.

The DeviceSecret must be 1 to 32 characters in length, and can contain letters, digits, hyphens (-), underscores (_), at signs (@), periods (.), and colons (:).

Note You can specify up to 10,000 DeviceSecrets in a single call. If the number of DeviceSecrets exceeds the limit, the excess DeviceSecrets are discarded.
DeviceList.N.Sn String No QC4******001

The serial number (SN) of the device.

The SN must be 1 to 64 characters in length, and can contain letters, digits, and underscores (_).

Note You can specify up to 10,000 SNs in a single call. If the number of SNs exceeds the limit, the excess SNs are discarded.
IotInstanceId String No iot-1n8t****

The ID of the instance. You can obtain the ID of the instance on the Overview tab in the IoT Platform console.

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

For more information, see Instance overview.

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

Response parameters

Parameter

Type

Example

Details

Code String iot.system.SystemException

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

Data Struct

The data returned if the call is successful. The data includes the information about the devices that failed to be verified.

InvalidDetailList Array of InvalidDetailList

The invalid devices.

DeviceName String light%

The DeviceName of the device.

DeviceSecret String ^67$

The secret of the device.

ErrorMsg String The device name is illegal.

The error message returned if the call fails.

Sn String QC4001#

The SN of the device.

InvalidDeviceNameList List { "InvalidDeviceNameList": [ "APT$", "aw" ] }

The invalid DeviceNames returned if the call fails.

InvalidDeviceSecretList List { "InvalidDeviceSecretList": [ "^67$", "1" ] }

The invalid DeviceSecrets returned if the call fails.

InvalidSnList List { "InvalidSnList": [ "" ] }

The invalid device SNs returned if the call fails.

RepeatedDeviceNameList List { "RepeatedDeviceNameList": [ "abcd", "asdf" ] }

The duplicate DeviceNames returned if the call fails.

ErrorMessage String A system exception occurred.

The error message returned if the call fails.

RequestId String E4C0FF92-2A86-41DB-92D3-73B60310D25E

The ID of the request.

Success Boolean true

Indicates whether the call was successful. Valid values:

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

Examples

Sample requests

http(s)://iot.cn-shanghai.aliyuncs.com/?Action=BatchCheckImportDevice
&DeviceList.1.DeviceName=device1
&DeviceList.2.DeviceName=device2
&DeviceList.1.DeviceSecret=b4d43f7******10ba5e5
&DeviceList.2.DeviceSecret=912179******700210b4
&ProductKey=a1BwAGV****
&IotInstanceId=iot-1n8t****
&<Common request parameters>

Sample success responses

XML format

<BatchCheckImportDeviceResponse>
  <RequestId>E4C0FF92-2A86-41DB-92D3-73B60310D25E</RequestId>
  <Success>true</Success>
</BatchCheckImportDeviceResponse>

JSON format

{
    "RequestId": "E4C0FF92-2A86-41DB-92D3-73B60310D25E",
    "Success": true
}

Error codes

HttpCode

Error Code

Error message

Description

400 iot.device.TooManyDeviceNamesPerRequest The devices you query exceed the maximum number. The number of DeviceNames that you specified in the request exceeds the limit.
400 iot.device.NoneDeviceNameElement The DeviceName list is empty. No DeviceNames are specified.
400 iot.device.InvalidDeviceParams The request parameters are invalid. The value of the request parameter is invalid.

For a list of error codes, see Service error codes.