調用該介面查看指定產品的發行物模型中的功能定義詳情。
QPS限制
單個阿里雲帳號調用該介面的每秒請求數(QPS)最大限制為10。
說明 單個阿里雲帳號下的所有RAM使用者共用該阿里雲帳號的配額。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
請求參數
| 名稱 | 類型 | 是否必選 | 樣本值 | 描述 |
| Action | String | 是 | QueryThingModelPublished | 系統規定參數。取值:QueryThingModelPublished。 |
| ProductKey | String | 是 | a1BwAGV**** | 產品的ProductKey。 |
| IotInstanceId | String | 否 | iot-cn-0pp1n8t**** | 執行個體ID。您可在物聯網平台控制台的執行個體概覽頁面,查看當前執行個體的ID。 重要
執行個體的更多資訊,請參見執行個體概述。 |
| ResourceGroupId | String | 否 | rg-acfm4l5tcwd*** | 資源群組ID。 重要 目前,物聯網平台僅支援執行個體維度資源群組管理。請求參數ResourceGroupId配置已無效,無需再傳入。
|
| ModelVersion | String | 否 | v1.0.0 | 物模型版本號碼。 可調用ListThingModelVersion查看產品下的物模型版本號碼。 為空白時返回發行的最新版本。 |
| FunctionBlockId | String | 否 | BatteryModule | 物模型自訂模組標識符,在產品中具有唯一性。 不傳入此參數時,查詢預設模組資料。 |
調用API時,除了本文介紹的該API的特有請求參數,還需傳入公用請求參數。公用請求參數說明,請參見公用參數文檔。
返回資料
| 名稱 | 類型 | 樣本值 | 描述 |
| Code | String | iot.system.SystemException | 調用失敗時,返回的錯誤碼。更多資訊,請參見錯誤碼。 |
| Data | Struct | 返回資料。 |
|
| ThingModelJson | String | {\"_ppk\":{\"version\":\"1594253010934\"},\"events\":[],\"productKey\":\"a1BwAGV****\",\"properties\":[{\"configCode\":\"8C03F0EEC63D4897BF2637F89AE36B011594227294067\",\"custom\":true,\"customFlag\":true,\"dataSpecs\":{\"custom\":true,\"dataType\":\"INT\",\"max\":\"1\",\"min\":\"0\",\"step\":\"1\",\"unit\":\"ppb\"},\"dataType\":\"INT\",\"description\":\"1\",\"extendConfig\":\"{\\\"originalDataType\\\":{\\\"specs\\\":{\\\"registerCount\\\":1,\\\"reverseRegister\\\":0,\\\"swap16\\\":0},\\\"type\\\":\\\"bool\\\"},\\\"identifier\\\":\\\"WakeUpData\\\",\\\"registerAddress\\\":\\\"0x04\\\",\\\"scaling\\\":1,\\\"writeFunctionCode\\\":0,\\\"operateType\\\":\\\"inputStatus\\\",\\\"pollingTime\\\":1000,\\\"trigger\\\":1}\",\"identifier\":\"WakeUpData\",\"name\":\"喚醒資料\",\"productKey\":\"a114xeJGj2p\",\"required\":false,\"rwFlag\":\"READ_ONLY\",\"std\":false}],\"services\":[]} | 物模型的功能定義。ThingModelJson取值的資料格式說明,請參見ThingModelJson資料說明。 |
| ErrorMessage | String | 系統異常 | 調用失敗時,返回的出錯資訊。 |
| ProductKey | String | a1BwAGV**** | 產品的ProductKey。 |
| RequestId | String | E4C0FF92-2A86-41DB-92D3-73B60310D25E | 阿里雲為該請求產生的唯一識別碼。 |
| Success | Boolean | true | 是否調用成功。
|
樣本
請求樣本
https://iot.cn-shanghai.aliyuncs.com/?Action=QueryThingModelPublished
&ProductKey=a1BwAGV****
&<公用請求參數>
正常返回樣本
XML格式
<QueryThingModelPublishedResponse>
<RequestId>1F9041A2-ED5B-4A5A-9C44-598E28C0B434</RequestId>
<Data>
<ThingModelJson>{"_ppk":{"version":"1594253010934"},"events":[],"productKey":"a1BwAGV****","properties":[{"configCode":"8C03F0EEC63D4897BF2637F89AE36B011594227294067","custom":true,"customFlag":true,"dataSpecs":{"custom":true,"dataType":"INT","max":"1","min":"0","step":"1","unit":"ppb"},"dataType":"INT","description":"1","extendConfig":"{\"originalDataType\":{\"specs\":{\"registerCount\":1,\"reverseRegister\":0,\"swap16\":0},\"type\":\"bool\"},\"identifier\":\"WakeUpData\",\"registerAddress\":\"0x04\",\"scaling\":1,\"writeFunctionCode\":0,\"operateType\":\"inputStatus\",\"pollingTime\":1000,\"trigger\":1}","identifier":"WakeUpData","name":"喚醒資料","productKey":"a114xeJ****","required":false,"rwFlag":"READ_ONLY","std":false}],"services":[]}</ThingModelJson>
</Data>
<Success>true</Success>
</QueryThingModelPublishedResponse>
JSON格式
{
"RequestId": "1F9041A2-ED5B-4A5A-9C44-598E28C0B434",
"Data": {
"ThingModelJson": "{\"_ppk\":{\"version\":\"1594253010934\"},\"events\":[],\"productKey\":\"a1BwAGV****\",\"properties\":[{\"configCode\":\"8C03F0EEC63D4897BF2637F89AE36B011594227294067\",\"custom\":true,\"customFlag\":true,\"dataSpecs\":{\"custom\":true,\"dataType\":\"INT\",\"max\":\"1\",\"min\":\"0\",\"step\":\"1\",\"unit\":\"ppb\"},\"dataType\":\"INT\",\"description\":\"1\",\"extendConfig\":\"{\\\"originalDataType\\\":{\\\"specs\\\":{\\\"registerCount\\\":1,\\\"reverseRegister\\\":0,\\\"swap16\\\":0},\\\"type\\\":\\\"bool\\\"},\\\"identifier\\\":\\\"WakeUpData\\\",\\\"registerAddress\\\":\\\"0x04\\\",\\\"scaling\\\":1,\\\"writeFunctionCode\\\":0,\\\"operateType\\\":\\\"inputStatus\\\",\\\"pollingTime\\\":1000,\\\"trigger\\\":1}\",\"identifier\":\"WakeUpData\",\"name\":\"喚醒資料\",\"productKey\":\"a114xeJGj2p\",\"required\":false,\"rwFlag\":\"READ_ONLY\",\"std\":false}],\"services\":[]}"
},
"Success": true
}
錯誤碼
訪問錯誤中心查看更多錯誤碼。