调用该接口查询指定品类的物模型信息。

请求参数

名称 类型 是否必需 描述
Action String 要执行的操作,取值:GetThingTemplate
CategoryKey String 要查询的品类的标识符。

可以从调用ListThingTemplates的返回数据中,查看各品类的CategoryKey

IotInstanceId String 公共实例不传此参数;您购买的实例需传入实例ID。
公共请求参数 - 请参见公共参数

返回参数

名称 类型 描述
RequestId String 阿里云为该请求生成的唯一标识符。
Success Boolean 是否调用成功。true表示调用成功,false表示调用失败。
ErrorMessage String 调用失败时,返回的出错信息。
Code String 调用失败时,返回的错误码。错误码详情,请参见错误码
ThingModelJSON String 调用成功时,返回的物模型功能定义,格式为:
{
  "properties":[],//属性列表
  "services":[],//服务列表
  "events":[],//事件列表
}

功能信息中包含的具体参数结构,请参见物模型格式

示例

请求示例

https://iot.cn-shanghai.aliyuncs.com/?Action=GetThingTemplate
&CategoryKey=Lighting
&公共请求参数

返回示例

  • JSON格式
    {
      "ThingModelJSON": "{\"services\":[{\"callType\":\"ASYNC\",\"custom\":false,\"description\":\"\",\"identifier\":\"TimeReset\",\"inputParams\":[{\"custom\":false,\"dataSpecs\":{\"dataType\":\"TEXT\",\"length\":255},\"dataType\":\"TEXT\",\"direction\":\"PARAM_INPUT\",\"identifier\":\"TimeReset\",\"name\":\"TimeReset\",\"paraOrder\":0}],\"outputParams\":[],\"required\":false,\"serviceName\":\"设备校时服务\"},{\"callType\":\"ASYNC\",\"custom\":false,\"description\":\"\",\"identifier\":\"SetTimerTask\",\"inputParams\":[],\"outputParams\":[{\"custom\":false,\"dataSpecs\":{\"dataType\":\"TEXT\",\"length\":255},\"dataType\":\"TEXT\",\"direction\":\"PARAM_OUTPUT\",\"identifier\":\"SetTimer\",\"name\":\"SetTimer\",\"paraOrder\":0}],\"required\":false,\"serviceName\":\"时间任务下发\"}],\"properties\":[{\"custom\":false,\"customFlag\":false,\"dataSpecsList\":[{\"dataType\":\"BOOL\",\"name\":\"打开\",\"value\":1},{\"dataType\":\"BOOL\",\"name\":\"关闭\",\"value\":0}],\"dataType\":\"BOOL\",\"description\":\"\",\"identifier\":\"LightStatus\",\"name\":\"工作状态\",\"required\":true,\"rwFlag\":\"READ_WRITE\",\"std\":true},{\"custom\":false,\"customFlag\":false,\"dataSpecs\":{\"dataType\":\"INT\",\"max\":\"100\",\"min\":\"0\",\"precise\":0,\"step\":\"1\",\"unit\":\"%\",\"unitName\":\"百分比\"},\"dataType\":\"INT\",\"description\":\"调光等级采用百分比表示\",\"identifier\":\"LightAdjustLevel\",\"name\":\"调光等级\",\"required\":true,\"rwFlag\":\"READ_WRITE\",\"std\":true},{\"custom\":false,\"customFlag\":false,\"dataSpecs\":{\"dataType\":\"FLOAT\",\"max\":\"4\",\"min\":\"0\",\"precise\":7,\"step\":\"0.1\",\"unit\":\"V\",\"unitName\":\"伏特\"},\"dataType\":\"FLOAT\",\"description\":\"显示设备电压;电参数采用4个字节浮点型数据\",\"identifier\":\"LightVolt\",\"name\":\"工作电压\",\"required\":true,\"rwFlag\":\"READ_ONLY\",\"std\":true},{\"custom\":false,\"customFlag\":false,\"dataSpecs\":{\"dataType\":\"FLOAT\",\"max\":\"9\",\"min\":\"0\",\"precise\":7,\"step\":\"0.1\",\"unit\":\"A\",\"unitName\":\"安培\"},\"dataType\":\"FLOAT\",\"description\":\"电参数采用4个字节浮点型数据\",\"identifier\":\"LightCurrent\",\"name\":\"工作电流\",\"required\":true,\"rwFlag\":\"READ_ONLY\",\"std\":true},{\"custom\":false,\"customFlag\":false,\"dataSpecs\":{\"dataType\":\"FLOAT\",\"max\":\"1000\",\"min\":\"0\",\"precise\":7,\"step\":\"0.1\",\"unit\":\"W\",\"unitName\":\"瓦特\"},\"dataType\":\"FLOAT\",\"description\":\"电参数采用4个字节浮点型数据\",\"identifier\":\"ActivePower\",\"name\":\"有功功率值\",\"required\":true,\"rwFlag\":\"READ_ONLY\",\"std\":true},{\"custom\":false,\"customFlag\":false,\"dataSpecs\":{\"dataType\":\"FLOAT\",\"max\":\"1\",\"min\":\"0.01\",\"precise\":7,\"step\":\"0.1\",\"unit\":\"pF\",\"unitName\":\"皮法\"},\"dataType\":\"FLOAT\",\"description\":\"电参数采用4个字节浮点型数据\",\"identifier\":\"PowerRatio\",\"name\":\"功率因数\",\"required\":true,\"rwFlag\":\"READ_ONLY\",\"std\":true},{\"custom\":false,\"customFlag\":false,\"dataSpecs\":{\"dataType\":\"FLOAT\",\"max\":\"2147483647\",\"min\":\"0\",\"precise\":7,\"step\":\"0.1\",\"unit\":\"kW·h\",\"unitName\":\"千瓦·时\"},\"dataType\":\"FLOAT\",\"description\":\"耗电量;电参数采用4个字节浮点型数据\",\"identifier\":\"PowerConsumption\",\"name\":\"用电量\",\"required\":true,\"rwFlag\":\"READ_ONLY\",\"std\":true},{\"custom\":false,\"customFlag\":false,\"dataSpecs\":{\"dataType\":\"FLOAT\",\"max\":\"400\",\"min\":\"0\",\"precise\":7,\"step\":\"0.1\",\"unit\":\"V\",\"unitName\":\"伏特\"},\"dataType\":\"FLOAT\",\"description\":\"电参数采用4个字节浮点型数据\",\"identifier\":\"DrainVoltage\",\"name\":\"漏电压\",\"required\":true,\"rwFlag\":\"READ_ONLY\",\"std\":true},{\"custom\":false,\"customFlag\":false,\"dataSpecs\":{\"dataType\":\"INT\",\"max\":\"90\",\"min\":\"0\",\"precise\":0,\"step\":\"1\",\"unit\":\"°\",\"unitName\":\"度\"},\"dataType\":\"INT\",\"description\":\"路灯的倾斜角度;采用1个字节16进制数\",\"identifier\":\"TiltValue\",\"name\":\"倾斜角度值\",\"required\":true,\"rwFlag\":\"READ_ONLY\",\"std\":true},{\"custom\":false,\"customFlag\":false,\"dataSpecs\":{\"dataType\":\"INT\",\"max\":\"1000\",\"min\":\"0\",\"precise\":0,\"step\":\"1\",\"unit\":\"W\",\"unitName\":\"瓦特\"},\"dataType\":\"INT\",\"description\":\"故障功率门限\",\"identifier\":\"ErrorPowerThreshold\",\"name\":\"故障功率门限\",\"required\":true,\"rwFlag\":\"READ_WRITE\",\"std\":true},{\"custom\":false,\"customFlag\":false,\"dataSpecs\":{\"dataType\":\"FLOAT\",\"max\":\"9\",\"min\":\"0.1\",\"precise\":7,\"step\":\"0.1\",\"unit\":\"A\",\"unitName\":\"安培\"},\"dataType\":\"FLOAT\",\"description\":\"\",\"identifier\":\"ErrorCurrentThreshold\",\"name\":\"故障电流门限\",\"required\":true,\"rwFlag\":\"READ_WRITE\",\"std\":true},{\"custom\":false,\"customFlag\":false,\"dataSpecs\":{\"dataType\":\"INT\",\"max\":\"90\",\"min\":\"0\",\"precise\":0,\"step\":\"1\",\"unit\":\"°\",\"unitName\":\"度\"},\"dataType\":\"INT\",\"description\":\"\",\"identifier\":\"TiltThreshold\",\"name\":\"倾斜阈值\",\"required\":true,\"rwFlag\":\"READ_WRITE\",\"std\":true},{\"custom\":false,\"customFlag\":false,\"dataSpecs\":{\"dataType\":\"INT\",\"max\":\"400\",\"min\":\"0\",\"precise\":0,\"step\":\"1\",\"unit\":\"V\",\"unitName\":\"伏特\"},\"dataType\":\"INT\",\"description\":\"\",\"identifier\":\"UnderVoltThreshold\",\"name\":\"欠压阈值\",\"required\":true,\"rwFlag\":\"READ_WRITE\",\"std\":true},{\"custom\":false,\"customFlag\":false,\"dataSpecs\":{\"dataType\":\"INT\",\"max\":\"9\",\"min\":\"0\",\"precise\":0,\"step\":\"1\",\"unit\":\"A\",\"unitName\":\"安培\"},\"dataType\":\"INT\",\"description\":\"\",\"identifier\":\"OverCurrentThreshold\",\"name\":\"过流阈值\",\"required\":true,\"rwFlag\":\"READ_WRITE\",\"std\":true},{\"custom\":false,\"customFlag\":false,\"dataSpecs\":{\"dataType\":\"INT\",\"max\":\"400\",\"min\":\"0\",\"precise\":0,\"step\":\"1\",\"unit\":\"V\",\"unitName\":\"伏特\"},\"dataType\":\"INT\",\"description\":\"\",\"identifier\":\"OverVoltThreshold\",\"name\":\"过压阈值\",\"required\":true,\"rwFlag\":\"READ_WRITE\",\"std\":true},{\"custom\":false,\"customFlag\":false,\"dataSpecsList\":[{\"dataType\":\"BOOL\",\"name\":\"打开\",\"value\":1},{\"dataType\":\"BOOL\",\"name\":\"关闭\",\"value\":0}],\"dataType\":\"BOOL\",\"description\":\"1:打开,0:关闭\",\"identifier\":\"LightErrorEnable\",\"name\":\"灯具故障使能\",\"required\":true,\"rwFlag\":\"READ_WRITE\",\"std\":true},{\"custom\":false,\"customFlag\":false,\"dataSpecsList\":[{\"dataType\":\"BOOL\",\"name\":\"打开\",\"value\":1},{\"dataType\":\"BOOL\",\"name\":\"关闭\",\"value\":0}],\"dataType\":\"BOOL\",\"description\":\"1:打开,0:关闭\",\"identifier\":\"OverCurrentEnable\",\"name\":\"过流告警使能\",\"required\":true,\"rwFlag\":\"READ_WRITE\",\"std\":true},{\"custom\":false,\"customFlag\":false,\"dataSpecsList\":[{\"dataType\":\"BOOL\",\"name\":\"打开\",\"value\":1},{\"dataType\":\"BOOL\",\"name\":\"关闭\",\"value\":0}],\"dataType\":\"BOOL\",\"description\":\"1:打开,0:关闭\",\"identifier\":\"OverVoltEnable\",\"name\":\"过压告警使能\",\"required\":true,\"rwFlag\":\"READ_WRITE\",\"std\":true},{\"custom\":false,\"customFlag\":false,\"dataSpecsList\":[{\"dataType\":\"BOOL\",\"name\":\"打开\",\"value\":1},{\"dataType\":\"BOOL\",\"name\":\"关闭\",\"value\":0}],\"dataType\":\"BOOL\",\"description\":\"1:打开,0:关闭\",\"identifier\":\"UnderVoltEnable\",\"name\":\"欠压告警使能\",\"required\":true,\"rwFlag\":\"READ_WRITE\",\"std\":true},{\"custom\":false,\"customFlag\":false,\"dataSpecsList\":[{\"dataType\":\"BOOL\",\"name\":\"打开\",\"value\":1},{\"dataType\":\"BOOL\",\"name\":\"关闭\",\"value\":0}],\"dataType\":\"BOOL\",\"description\":\"1:打开,0:关闭\",\"identifier\":\"LeakageEnable\",\"name\":\"漏电告警使能\",\"required\":true,\"rwFlag\":\"READ_WRITE\",\"std\":true},{\"custom\":false,\"customFlag\":false,\"dataSpecsList\":[{\"dataType\":\"BOOL\",\"name\":\"打开\",\"value\":1},{\"dataType\":\"BOOL\",\"name\":\"关闭\",\"value\":0}],\"dataType\":\"BOOL\",\"description\":\"1:打开,0:关闭\",\"identifier\":\"OverTiltEnable\",\"name\":\"倾斜告警使能\",\"required\":true,\"rwFlag\":\"READ_WRITE\",\"std\":true},{\"custom\":false,\"customFlag\":false,\"dataSpecsList\":[{\"dataType\":\"BOOL\",\"name\":\"告警\",\"value\":1},{\"dataType\":\"BOOL\",\"name\":\"正常\",\"value\":0}],\"dataType\":\"BOOL\",\"description\":\"1-告警;0-正常\",\"identifier\":\"LampError\",\"name\":\"灯具故障告警\",\"required\":true,\"rwFlag\":\"READ_ONLY\",\"std\":true},{\"custom\":false,\"customFlag\":false,\"dataSpecsList\":[{\"dataType\":\"BOOL\",\"name\":\"告警\",\"value\":1},{\"dataType\":\"BOOL\",\"name\":\"正常\",\"value\":0}],\"dataType\":\"BOOL\",\"description\":\"1-告警;0-正常\",\"identifier\":\"OverCurrentError\",\"name\":\"过流告警\",\"required\":true,\"rwFlag\":\"READ_ONLY\",\"std\":true},{\"custom\":false,\"customFlag\":false,\"dataSpecsList\":[{\"dataType\":\"BOOL\",\"name\":\"告警\",\"value\":1},{\"dataType\":\"BOOL\",\"name\":\"正常\",\"value\":0}],\"dataType\":\"BOOL\",\"description\":\"1-告警;0-正常\",\"identifier\":\"OverVoltError\",\"name\":\"过压告警\",\"required\":true,\"rwFlag\":\"READ_ONLY\",\"std\":true},{\"custom\":false,\"customFlag\":false,\"dataSpecsList\":[{\"dataType\":\"BOOL\",\"name\":\"告警\",\"value\":1},{\"dataType\":\"BOOL\",\"name\":\"正常\",\"value\":0}],\"dataType\":\"BOOL\",\"description\":\"1-告警;0-正常\",\"identifier\":\"UnderVoltError\",\"name\":\"欠压告警\",\"required\":true,\"rwFlag\":\"READ_ONLY\",\"std\":true},{\"custom\":false,\"customFlag\":false,\"dataSpecsList\":[{\"dataType\":\"BOOL\",\"name\":\"告警\",\"value\":1},{\"dataType\":\"BOOL\",\"name\":\"正常\",\"value\":0}],\"dataType\":\"BOOL\",\"description\":\"1-告警;0-正常\",\"identifier\":\"OverTiltError\",\"name\":\"倾斜告警\",\"required\":true,\"rwFlag\":\"READ_ONLY\",\"std\":true},{\"custom\":false,\"customFlag\":false,\"dataSpecsList\":[{\"dataType\":\"BOOL\",\"name\":\"告警\",\"value\":1},{\"dataType\":\"BOOL\",\"name\":\"正常\",\"value\":0}],\"dataType\":\"BOOL\",\"description\":\"1-告警;0-正常\",\"identifier\":\"LeakageError\",\"name\":\"漏电告警\",\"required\":true,\"rwFlag\":\"READ_ONLY\",\"std\":true},{\"custom\":false,\"customFlag\":false,\"dataSpecsList\":[{\"childDataType\":\"DOUBLE\",\"childName\":\"经度\",\"childSpecsDTO\":{\"dataType\":\"DOUBLE\",\"max\":\"180\",\"min\":\"-180\",\"precise\":7,\"step\":\"0.01\",\"unit\":\"°\",\"unitName\":\"度\"},\"dataSpecs\":{\"$ref\":\"$.properties[27].dataSpecsList[0].childSpecsDTO\"},\"dataSpecsObject\":{\"unit\":\"°\",\"min\":\"-180\",\"unitName\":\"度\",\"max\":\"180\",\"dataType\":\"double\",\"step\":\"0.01\",\"precise\":7},\"dataType\":\"STRUCT\",\"identifier\":\"longitude\",\"name\":\"地理位置\"},{\"childDataType\":\"DOUBLE\",\"childName\":\"纬度\",\"childSpecsDTO\":{\"dataType\":\"DOUBLE\",\"max\":\"180\",\"min\":\"-180\",\"precise\":7,\"step\":\"0.01\",\"unit\":\"°\",\"unitName\":\"度\"},\"dataSpecs\":{\"$ref\":\"$.properties[27].dataSpecsList[1].childSpecsDTO\"},\"dataSpecsObject\":{\"unit\":\"°\",\"min\":\"-180\",\"unitName\":\"度\",\"max\":\"180\",\"dataType\":\"double\",\"step\":\"0.01\",\"precise\":7},\"dataType\":\"STRUCT\",\"identifier\":\"latitude\",\"name\":\"地理位置\"},{\"childDataType\":\"DOUBLE\",\"childName\":\"高度\",\"childSpecsDTO\":{\"dataType\":\"DOUBLE\",\"max\":\"9999\",\"min\":\"0\",\"precise\":7,\"step\":\"0.01\",\"unit\":\"m\",\"unitName\":\"米\"},\"dataSpecs\":{\"$ref\":\"$.properties[27].dataSpecsList[2].childSpecsDTO\"},\"dataSpecsObject\":{\"unit\":\"m\",\"min\":\"0\",\"unitName\":\"米\",\"max\":\"9999\",\"dataType\":\"double\",\"step\":\"0.01\",\"precise\":7},\"dataType\":\"STRUCT\",\"identifier\":\"altitude\",\"name\":\"地理位置\"},{\"childDataType\":\"ENUM\",\"childEnumSpecsDTO\":[{\"dataType\":\"ENUM\",\"name\":\"WGS_84\",\"value\":1},{\"dataType\":\"ENUM\",\"name\":\"GCJ_02\",\"value\":2}],\"childName\":\"坐标系统\",\"dataSpecsArray\":[{\"dataType\":\"enum\",\"name\":\"WGS_84\",\"value\":\"1\"},{\"dataType\":\"enum\",\"name\":\"GCJ_02\",\"value\":\"2\"}],\"dataSpecsList\":[{\"dataType\":\"ENUM\",\"name\":\"WGS_84\",\"value\":1},{\"dataType\":\"ENUM\",\"name\":\"GCJ_02\",\"value\":2}],\"dataType\":\"STRUCT\",\"identifier\":\"CoordinateSystem\",\"name\":\"地理位置\"}],\"dataType\":\"STRUCT\",\"description\":\"\",\"identifier\":\"GeoLocation\",\"name\":\"地理位置\",\"required\":true,\"rwFlag\":\"READ_WRITE\",\"std\":true},{\"custom\":false,\"customFlag\":false,\"dataSpecs\":{\"dataType\":\"INT\",\"max\":\"65535\",\"min\":\"0\",\"precise\":0,\"step\":\"1\",\"unit\":\"LUX\",\"unitName\":\"照度\"},\"dataType\":\"INT\",\"description\":\"\",\"identifier\":\"LightLux\",\"name\":\"光照值\",\"required\":false,\"rwFlag\":\"READ_ONLY\",\"std\":true}],\"events\":[]}",
      "RequestId": "B79DEAAF-74F3-4AFF-95C3-FC8CDB8B831A",
      "Success": true
    }
  • XML格式
    <?xml version='1.0' encoding='utf-8'?>
    <GetThingTemplateResponse>
        <RequestId>57b144cf-09fc-4916-a272-a62902d5b207</RequestId>
        <Success>true</Success>
        <ThingModelJSON>{\"services\":[{\"callType\":\"ASYNC\",\"custom\":false,\"description\":\"\",\"identifier\":\"TimeReset\",\"inputParams\":[{\"custom\":false,\"dataSpecs\":{\"dataType\":\"TEXT\",\"length\":255},\"dataType\":\"TEXT\",\"direction\":\"PARAM_INPUT\",\"identifier\":\"TimeReset\",\"name\":\"TimeReset\",\"paraOrder\":0}],\"outputParams\":[],\"required\":false,\"serviceName\":\"设备校时服务\"},{\"callType\":\"ASYNC\",\"custom\":false,\"description\":\"\",\"identifier\":\"SetTimerTask\",\"inputParams\":[],\"outputParams\":[{\"custom\":false,\"dataSpecs\":{\"dataType\":\"TEXT\",\"length\":255},\"dataType\":\"TEXT\",\"direction\":\"PARAM_OUTPUT\",\"identifier\":\"SetTimer\",\"name\":\"SetTimer\",\"paraOrder\":0}],\"required\":false,\"serviceName\":\"时间任务下发\"}],\"properties\":[{\"custom\":false,\"customFlag\":false,\"dataSpecsList\":[{\"dataType\":\"BOOL\",\"name\":\"打开\",\"value\":1},{\"dataType\":\"BOOL\",\"name\":\"关闭\",\"value\":0}],\"dataType\":\"BOOL\",\"description\":\"\",\"identifier\":\"LightStatus\",\"name\":\"工作状态\",\"required\":true,\"rwFlag\":\"READ_WRITE\",\"std\":true}</ThingModelJSON>
    </GetThingTemplateResponse>