You can call this operation to modify the aliases of multiple devices.

Request parameters

Parameter Type Required Description
Action String Yes The operation that you want to perform. Set the value to BatchUpdateDeviceNickname.
DeviceNicknameInfo List<String> Yes Includes the device identifier parameters and the Nickname parameter. The device identifier parameters include the combination of ProductKey and DeviceName and the IotId parameter.
Note
  • The device identifier parameters are required to identify a device.
  • The Nickname parameter is optional. If you do not provide this parameter, the original alias of the specified device will be deleted.
For more information, see the following table: Parameters in DeviceNicknameInfo.
Common request parameters N/A Yes See Common parameters.
Table 1. Parameters in DeviceNicknameInfo
Parameter Type Required Description
IotId String No

The identifier of the device of which the alias to be modified.

Note If you provide this parameter, you do not need to provide the ProductKey or DeviceName parameters. As the GUID of the device, IotId corresponds to the combination of ProductKey and DeviceName. If you provide both IotId and the combination of ProductKey and DeviceName, IotId takes precedence.
ProductKey String No

The key of the product to which the device belongs.

Note If you provide this parameter, you must also provide DeviceName.
DeviceName String No

The name of the device to be queried.

Note If you provide this parameter, you must also provide ProductKey.
Nickname String No The new alias for the device. An alias must be 4 to 32 characters in length and can contain Chinese characters, letters, numbers, and underscores (_). One Chinese character is counted as two characters.
Note If you do not provide this parameter, the original alias of the device will be deleted.

Response parameters

Parameter Type Description
RequestId String The GUID 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.

Examples

Sample request

https://iot.cn-shanghai.aliyuncs.com/?Action=BatchUpdateDeviceNickname
&DeviceNicknameInfo. 1. ProductKey=a1rYuVF****
&DeviceNicknameInfo. 1. DeviceName=SR8FiTu1R9tlUR2V1bmi
&DeviceNicknameInfo. 1. Nickname=airconditioning_type1
&DeviceNicknameInfo. 2. ProductKey=a1yrZMH****
&DeviceNicknameInfo. 2. DeviceName=RkQ8CFtNpDok4BEunymt
&DeviceNicknameInfo. 2. Nickname=airconditioning_type2
&Common request parameters

Sample responses

  • JSON format
    {
      "RequestId":"57b144cf-09fc-4916-a272-a62902d5b207",
      "Success": true
    }
  • XML format
    <? xml version="1.0" encoding="UTF-8"? >
    <BatchUpdateDeviceNicknameResponse>
        <RequestId>57b144cf-09fc-4916-a272-a62902d5b207</RequestId>
        <Success>true</Success>
    </BatchUpdateDeviceNicknameResponse>