Obtains the TSL version list of a specified product.

Description

IoT Platform provides version control for TSL. After you import a TSL (ImportThingModelTsl), copy the TSL of other products (CopyThingModel), or edit a TSL, you must call the PublishThingModel operation and publish the TSL before you can use it. A new version is generated each time a TSL of a product is published.

Request parameters

Parameter Type Required Description
Action String Yes The operation that you want to perform. Set the value to ListThingModelVersion.
ProductKey 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.

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 Alibaba Cloud 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 more information about error codes, see Error codes.
Data Struct The data returned when the call is successful.

For more information about the parameters, see the ModelVersions table.

Table 1. ModelVersions
Parameter Type Description
ModelVersions List The list of TSL versions. The list is in descending order based on the release time of the TSLs. The first version is the current version.

For more information about the parameters, see the ModelVersion table.

Table 2. ModelVersion
Parameter Type Description
ModelVersion String The version of the TSL.
GmtCreate Long The timestamp when the TSL version was released in GMT. Unit: milliseconds.
Description String The description of the TSL version.

Examples

Sample requests

https://iot.cn-shanghai.aliyuncs.com/?Action=ListThingModelVersion
&ProductKey=a1rYuVF****
&<Common request parameters>

Sample responses

  • JSON format
    {
      "Data": {
        "ModelVersions": [
          {
            "ModelVersion": "V3.0.0",
            "GmtCreate": 1579235682421,
            "Description": "new properties"
          },
          {
            "ModelVersion": "V2.0.0",
            "GmtCreate": 1579235657535,
            "Description": "new properties"
          },
          {
            "ModelVersion": "V1.0.0",
            "GmtCreate": 1579235637994,
            "Description": "Lighting"
          }
        ]
      },
      "RequestId": "9BA34AE5-2D94-4BDE-BD78-E7D3FC7985BC",
      "Success": true
    }
  • XML format
    <? xml version="1.0" encoding="UTF-8" ? >
    <ListThingModelVersionResponse>
        <Data>
          <ModelVersions>
            <ModelVersion>
              <ModelVersion>V3.0.0</ModelVersion>
              <GmtCreate>1579235682420</GmtCreate>
              <Description>new properties</Description>
            </ModelVersion>
            <ModelVersion>
              <ModelVersion>V2.0.0</ModelVersion>
              <GmtCreate>1579235657535</GmtCreate>
              <Description>new properties</Description>
            </ModelVersion>
            <ModelVersion>
              <ModelVersion>V1.0.0</ModelVersion>
              <GmtCreate>1579235637993</GmtCreate>
              <Description>Lighting</Description>
            </ModelVersion>
          </ModelVersions>
        </Data>
        <RequestId>E55E50B7-40EE-4B6B-8BBE-D3ED55CCF565</RequestId>
        <Success>true</Success>
    </ListThingModelVersionResponse>