Copies the TSL of a specified product to the target product.

Limits

The category of the specified product and the product of the TSL must be the same.

Request parameters

Parameter Type Required Description
Action String Yes The operation that you want to perform. Set the value to CopyThingModel.
ProductKeySource String Yes The key of the product to which the TSL belongs.

You can log on to the IoT Platform console and view it on the Product page. You can also call the QueryProductList operation to obtain the ProductKey value.

ProductKeyTarget String Yes The key of the product to which the device belongs.

You can log on to the IoT Platform console and view it on the Product page. You can also call the QueryProductList operation to obtain the ProductKey value.

SourceModelVersion String Yes The version of the TSL to be copied.

You can call the ListThingModelVersion operation to view the version of the TSL version.

IotInstanceId String No The ID of the instance. This parameter is not required for public instances. However, the parameter is required for the instances that you have purchased.
Common request parameters - Yes For more information, see Common parameters.

Response parameters

Parameter Type Description
RequestId String The globally unique ID generated by IoT Platform for the request.
Success Boolean Indicates whether the call was successful. true indicates that the call was successful. false indicates that the call failed.
ErrorMessage String The error message returned if the call fails.
Code String The error code returned if the call fails. For information about error codes, see Error codes.

Examples

Sample requests

https://iot.cn-shanghai.aliyuncs.com/?Action=CopyThingModel
&ProductKeySource=a1rYuVF****
&ProductKeyTarget=a1bPo9p****
&SourceModelVersion=v1.0.0
&<Common request parameters>

Sample responses

  • JSON format
    {
      "RequestId": "9E76053E-26ED-4AB4-AE58-8AFC3F1E7E8E",
      "Success": true
    }
  • XML format
    <? xml version="1.0" encoding="UTF-8" ? >
    <CopyThingModelResponse>
        <RequestId>9E76053E-26ED-4AB4-AE58-8AFC3F1E7E8E</RequestId>
        <Success>true</Success>
    </CopyThingModelResponse>