获取物的模型
更新时间:2026-04-02 14:57:05
调用该接口获取物的模型。
| 描述 | 值 |
|---|---|
| 路径 | /platform/product/thing/spec/list |
| 版本号 | 1.0.0 |
| 协议 | HTTPS |
| 请求方法 | POST |
请求参数:
公共请求参数见 公共请求参数
| 请求字段 | 类型 | 必选 | 描述 |
|---|---|---|---|
| productKey | String | 是 | 产品的Key |
| typeList | List | 否 | 类型列表,0 - 属性;1 - 服务;2 - 事件; 若为空,则返回所有类型的模型定义 |
返回参数:
| 返回字段 | 类型 | 描述 |
|---|---|---|
| id | String | 用于识别请求记录,即对应的请求ID。 |
| code | Int | 接口返回码字段,请求成功时返回200;请求失败时返回详细的错误码。 |
| message | String | 调用失败时,返回的出错信息 |
| data | Object | 响应的结果。 |
| specs | List | 物的模型列表。 |
| name | String | 名称 |
| sign | String | 标识符 |
| type | int | 类型,0 - 属性;1 - 服务;2 - 事件 |
| spec | String | 模型描述,由具体业务定义 |
请求示例:
x-ca-key: xxxxxxxx
x-ca-timestamp: 1728634151000
x-ca-nonce: 7b25fc15b9434dd98587a077a92b7e42
x-ca-signature: yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
Content-Type: application/json;charset=UTF-8
{
"id": "49a7be925e******9b08ba0facf7",
"version": "1.0",
"request": {
"apiVer": "1.0.0"
},
"params": {
"productKey": "pk1",
"typeList": [0]
}
}
成功返回示例:
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Cache-Control: no-store
Pragma: no-cache
{
"id": "49a7be925e******9b08ba0facf7",
"code": 200,
"message": "success",
"data": {
"specs": [{
"name": "动作方向",
"sign": "actionDirection",
"type": 0,
"spec": "{\"name\": \"动作方向\", \"dataType\": {\"type\": \"enum\", \"specs\": {\"1\": \"前进\", \"2\": \"后退\", \"3\": \"左转\", \"4\": \"右转\", \"5\": \"停止\", \"6\": \"起立\", \"7\": \"坐下\", \"8\": \"上升\", \"9\": \"下降\"}}, \"required\": false, \"accessMode\": \"rw\", \"identifier\": \"actionDirection\"}"
}]
}
}