GetTSL

Updated at:

Call this operation to retrieve the Thing Specification Language (TSL) model data for a specific product.

Request syntax

GET /2020-04-30/tsls/ProdcutKey HTTP/1.1
Cookie: Cookie
Important 2020-04-30 is the version number of the edge OpenAPI. This value cannot be changed.

Request parameters

Parameter NameTypeRequiredDescription
ProductKeyStringYesThe unique identifier of the product to which the device belongs.
CookieStringYesThe authentication cookie created by calling the CreateAuthCookie operation.

Return Syntax

HTTP/1.1 StatusCode
Content-Type: application/json

Payload

Response parameters

ParameterTypeDescription
StatusCodeNumberThe HTTP status code. A status code of 200 indicates a successful call. Other status codes indicate a failed call. For more information about status codes, see Status codes.
PayloadJSONThe TSL model information of the product. For the format, see the payload format below the table.

The following code shows the format of the returned data.

{   
    "Data": {
      "TSL": {}
    }
  }

Example

$ curl -i -b token.cookie -k https://127.0.0.1:9999/2020-04-30/tsls/a1t****n42K

HTTP/1.1 200 OK
Server: openresty/1.13.6.2
Date: Tue, 21 Apr 2020 13:30:37 GMT
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive

{"Data":{"TSL":{"schema":"https://iotx-tsl.oss-ap-southeast-1.aliyuncs.com/schema.json","services":[{"desc":"Set properties","method":"thing.service.property.set","identifier":"set","inputData":[],"required":true,"outputData":[],"name":"set","callType":"async"},{"desc":"Get properties","method":"thing.service.property.get","identifier":"get","inputData":["MeasuredIlluminance"],"required":true,"outputData":[{"dataType":{"type":"double","specs":{"max":"65535","unit":"Lux","step":"0.01","min":"0","unitName":"Illuminance"}},"identifier":"MeasuredIlluminance","name":"Measured illuminance value"}],"name":"get","callType":"async"}],"profile":{"productKey":"a1t****n42K"},"events":[{"desc":"Report properties","method":"thing.event.property.post","identifier":"post","type":"info","outputData":[{"dataType":{"type":"double","specs":{"max":"65535","unit":"Lux","step":"0.01","min":"0","unitName":"Illuminance"}},"identifier":"MeasuredIlluminance","name":"Measured illuminance value"}],"name":"post","required":true},{"method":"thing.event.LowIlluminance.post","identifier":"LowIlluminance","type":"alert","outputData":[{"dataType":{"type":"double","specs":{"max":"65535","unit":"lm","min":"0","step":"0.01"}},"identifier":"MeasuredIlluminance","name":"Measured illuminance value"},{"dataType":{"type":"int","specs":{"max":"50","min":"-50","step":"1"}},"identifier":"int32","name":"Integer parameter"},{"dataType":{"type":"float","specs":{"max":"50.0","min":"-50.0","step":"0.1"}},"identifier":"float","name":"Single-precision floating-point parameter"},{"dataType":{"type":"double","specs":{"max":"50.0","min":"-50.0","step":"0.1"}},"identifier":"double","name":"Double-precision floating-point parameter"},{"dataType":{"type":"enum","specs":{"1":"1","2":"2"}},"identifier":"enum","name":"Enumeration parameter"},{"dataType":{"type":"bool","specs":{"1":"1","0":"0"}},"identifier":"bool","name":"Boolean parameter"},{"dataType":{"type":"text","specs":{"length":"2048"}},"identifier":"text","name":"String parameter"},{"dataType":{"type":"date","specs":[]},"identifier":"date","name":"Date type"},{"dataType":{"type":"array","specs":{"size":"10","item":{"type":"int"}}},"identifier":"array","name":"Array parameter"}],"name":"Low illuminance alert","required":false}],"properties":[{"accessMode":"r","dataType":{"type":"double","specs":{"max":"65535","unit":"Lux","step":"0.01","min":"0","unitName":"Illuminance"}},"required":true,"name":"Measured illuminance value","identifier":"MeasuredIlluminance"}]}}}