Call this operation to register multiple devices in a specified product with device names randomly generated by the system.

Limits

The names of the devices that you registered using this API are generated by the system, and you cannot specify names for the devices. You can register up to 1,000 devices in a single call.

If you want to register one device individually, you can call the RegisterDevice operation.

If you want to register multiple devices in a product at a time, and specify the name for each device, call BatchCheckDeviceNames to specify device names, and then call BatchRegisterDeviceWithApplyId to register the devices.

Request parameters

Parameter Type Required Description
Action String Yes The operation that you want to perform. Set the value to RegisterDevice.
ProductKey String Yes The key of the product in which you want to register devices.
Count Integer Yes The number of devices that you want to register, which cannot exceed 1,000.
Common Request Parameters - Yes See Common parameters.

Response parameters

Parameter Type Description
RequestId String The globally unique ID generated by Alibaba Cloud for the request.
Success Boolean Indicates whether the call is successful. A value of true indicates that the call is successful. A value of false indicates that the call has failed.
ErrorMessage String The error message returned when the call fails.
Code String The error code returned when the call fails. For more information about error codes, see Error codes.
Data Data The data returned when the call is successful. For more information, see the following table Data.
Table 1. Data
Parameter Type Description
ApplyId Long The application ID (ApplyId) returned when the call is successful.

Examples

Request example

https://iot.cn-shanghai.aliyuncs.com/?Action=BatchRegisterDevice
&ProductKey=al*********
&Count=10
&Public Request Parameters

Response example

  • JSON format

    {
      "RequestId":"57b144cf-09fc-4916-a272-a62902d5b207",  
      "Success": true,
      "Data": {
        "ApplyId": 4415
      }
    }
  • XML format

    <? xml version='1.0' encoding='utf-8'? >
    <BatchRegisterDeviceResponse>
        <RequestId>57b144cf-09fc-4916-a272-a62902d5b207</RequestId>
        <Success>true</Success>
        <Data>
            <ApplyId>4415</ApplyId>
        </Data>
    </BatchRegisterDeviceResponse>