Publishes the Thing specification Language (TSL) of a specified product.

Request parameters

Parameter Type Required Description
Action String Yes The operation that you want to perform. Set the value to PublishThingModel.
ProductKey String Yes The key of the product to which the device belongs.

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

ModelVersion String Yes The version of the TSL.

The version can contain letters, digits, and periods (.). It must be 1 to 16 characters in length.

Description String No The description 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=PublishThingModel
&ProductKeySource=a1rYuVF****
&ModelVersion=V1.0.0
&<Common request parameters>

Sample responses

  • JSON format
    {
      "RequestId": "5252CC6E-9E4B-4DB1-B1D8-7EEA190A5B3E",
      "Success": true
    }
  • XML format
    <? xml version="1.0" encoding="UTF-8"? >
     <PublishThingModelResponse>
          <RequestId>5252CC6E-9E4B-4DB1-B1D8-7EEA190A5B3E</RequestId>
          <Success>true</Success>
      </PublishThingModelResponse>