Creates multiple custom device names under a specified product. IoT Platform checks the validity of these names.

API usage

You must use this operation with the BatchRegisterDeviceWithApplyId operation to register multiple devices with custom names under a product.

Procedure:

1. Call the BatchCheckDeviceNames operation to specify the names of the devices to be registered. IoT Platform returns the ApplyId parameter. If the call is successful, a request to verify the device names is submitted. IoT Platform asynchronously verifies the device names.

2. Call the QueryBatchRegisterDeviceStatus operation to query the name setting result.

3. Call the BatchRegisterDeviceWithApplyId operation to register the devices.

4. Optional. Call the QueryBatchRegisterDeviceStatus operation to query the device registration result.

5. Call the QueryPageByApplyId operation to view the details of devices that are registered in batches.

Limits

  • You can specify a maximum of 10,000 device names in a single call.
  • Each Alibaba Cloud account can run a maximum of 10 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 the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes BatchCheckDeviceNames

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

ProductKey String Yes a1BwAGV****

The ProductKey of the product to which the device belongs.

IotInstanceId String No iot-cn-0pp1n8t****

The instance ID. This parameter is not required for public instances. However, this parameter is required for Enterprise Edition instances.

DeviceName.N RepeatList No light

The name of the device. The device name must be unique within the product. The device name must be 4 to 32 characters in length, and can contain letters, digits, hyphens (-), underscores (_), periods (.), at signs (@), and colons (:).

You must specify this parameter or the DeviceNameList.N.DeviceName parameter. If you specify this parameter and the DeviceNameList.N.DeviceName parameter at the same time, the DeviceNameList.N.DeviceName parameter is used by default.

Note You can specify up to 10,000 device names in a single call. If the size of a message reaches this limit, the message is discarded.
DeviceNameList.N.DeviceName String No light1

The name of the device. The device name must be unique within the product. The device name must be 4 to 32 characters in length, and can contain letters, digits, hyphens (-), underscores (_), periods (.), at signs (@), and colons (:).

You must specify this parameter or the DeviceName.N parameter. If you specify this parameter and the DeviceName.N parameter at the same time, this parameter is used by default.

Note You can specify up to 10,000 device names in a single call. If the size of a message reaches this limit, the message is discarded.
DeviceNameList.N.DeviceNickname String No Smart light 1

The alias of the device. The alias must be 4 to 64 characters in length, and can contain letters, digits, and underscores (_).

If this parameter is specified, you must specify the DeviceNameList.N.DeviceName parameter.

In addition to the preceding operation-specific request parameters, you must specify common request parameters when you call this API 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 returned data.

ApplyId Long 1295006

The application ID returned if the call succeeds. When you call the BatchRegisterDeviceWithApplyId operation to register the devices, this parameter is required.

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

The list of invalid device names returned if the call fails.

InvalidDeviceNicknameList List { "InvalidDeviceNickname": [ "APT$", "aw" ] }

The list of invalid device aliases returned if the call fails.

ErrorMessage String A system exception has 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 succeeds.

  • true: The call succeeded.
  • false: The call failed.

Examples

Sample requests

https://iot.cn-shanghai.aliyuncs.com/?Action=BatchCheckDeviceNames
&productKey=a1BwAGV****
&DeviceNameList.1.DeviceName=light1
&DeviceNameList.2.DeviceName=light2
&DeviceNameList.3.DeviceName=light3
&DeviceNameList.3.DeviceNickname=Smart light 3
&<Common request parameters>

Sample success responses

XML format

<BatchCheckDeviceNamesResponse>
  <Data>
        <ApplyId>1234567</ApplyId>
  </Data>
  <RequestId>E976E36B-6874-4FA4-8BC0-55F9BEC5E2EF</RequestId>
  <Success>true</Success>
</BatchCheckDeviceNamesResponse>

JSON format

{
    "Data": {
        "ApplyId": 1234567
    },
    "RequestId": "E976E36B-6874-4FA4-8BC0-55F9BEC5E2EF",
    "Success": true
}

Error codes

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