产品管理
产品创建
请求URL
https://www.thingshub.com.cn/openapi/v2/product/save
方法
POST
Content-Type
application/www-x-form-urlencoded
请求参数
参数 | 数据类型 | 必填 | 说明 |
---|---|---|---|
projectCode | string | 否 | 项目编码 |
nodeType | int | 是 | 节点类型 |
gatewayType | int | 是 | 是否加入网关 |
categoryId | string | 是 | 产品分类ID |
networkType | int | 否 | 联网方式 |
dataType | int | 否 | 数据格式类型 |
productName | string | 是 | 产品名称 |
remark | string | 否 | 备注 |
响应参数
参数 | 数据类型 | 必填 | 说明 |
---|---|---|---|
code | int | 是 | 返回码 |
msg | string | 是 | 返回消息 |
data | object | 是 | 返回数据 |
id | int | 是 | 产品ID |
projectCode | string | 是 | 项目编码 |
productKey | string | 是 | ProductKey |
productName | string | 是 | 产品名称 |
nodeType | int | 是 | 节点类型 |
gatetwayType | int | 是 | 是否接入网关 |
categoryId | string | 是 | 产品分类ID |
networkType | int | 是 | 联网方式 |
dataType | int | 是 | 数据格式类型 |
createTime | string | 是 | 创建时间 |
remark | string | 是 | 备注 |
节点类型 nodeType
- 0 设备
- 1 网关
是否加入网关 gatewayType
- 0 否
- 1 是
联网方式 networkType
- 不加入网关
- 4 蜂窝网络
- 5 WiFi
- 6 以太网
- 7 LoRaWAN
- 8 其他
- 加入网关
- 9 Modbus
- 10 Zigbee
- 11 BLE
- 12 OPC UA
- 13 自定义
数据格式标准 dataType
- 0 标准
- 1 非标准
响应样例
{
"code": 200,
"msg": "success",
"data": {
"id": 0,
"projectCode": "",
"productKey": "",
"nodeType": 0,
"gatewayType": 0,
"categoryId": "",
"networkType": 0,
"productName": "门禁",
"status": "0",
"remark": "门禁",
"dataType": 0
}
}
产品列表查询
请求URL
https://www.thingshub.com.cn/openapi/v2/product/list-product
方法
GET
Content-Type
无
请求参数
参数 | 数据类型 | 必填 | 说明 |
---|---|---|---|
projectCode | string | 是 | 项目编码 |
响应参数
参数 | 数据类型 | 必填 | 说明 |
---|---|---|---|
code | int | 是 | 返回码 |
msg | string | 是 | 返回消息 |
data | array | 是 | 返回数据 |
+id | int | 是 | 产品ID |
+projectCode | string | 是 | 项目编码 |
+productKey | string | 是 | ProductKey |
+nodeType | int | 是 | 节点类型 |
+gatewayType | int | 是 | 是否接入网关 |
+networkType | int | 是 | 连网类型 |
+productName | string | 是 | 产品名称 |
+createTime | string | 是 | 创建时间 |
+remark | string | 是 | 备注 |
+dataType | int | 是 | 是否标准数据格式 |
样例
{
"code": 200,
"msg": "success",
"data": [
{
"id": 0,
"projectCode": "",
"productKey": "",
"nodeType": 0,
"gatewayType": 0,
"networkType": 0,
"productName": "门禁",
"createTime": "2025-07-04 10:43:38",
"remark": "门禁",
"dataType": 0
}
]
}
产品详情
请求URL
https://www.thingshub.com.cn/openapi/v2/product/detail
方法
GET
Content-Type
无
请求参数
参数 | 数据类型 | 必填 | 说明 |
---|---|---|---|
productId | int | 是 | 产品ID |
响应参数
参数 | 数据类型 | 必填 | 说明 |
---|---|---|---|
code | int | 是 | 返回码 |
msg | string | 是 | 返回消息 |
data | array | 是 | 返回数据 |
+product | object | 是 | 产品信息 |
++id | int | 是 | 产品ID |
++projectCode | string | 是 | 项目编码 |
++productKey | string | 是 | ProductKey |
++nodeType | string | 是 | 节点类型 |
++gatewayType | string | 是 | 是否接入网关 |
++networkType | string | 是 | 连网类型 |
++productName | string | 是 | 产品名称 |
++categoryName | string | 是 | 分类名称 |
++createTime | string | 是 | 创建时间 |
++remark | string | 是 | 备注 |
++dataType | string | 是 | 是否标准数据格式 |
+count | int | 是 | 设备数 |
样例
{
"code": 200,
"msg": "success",
"data": {
"product": {
"id": 0,
"productKey": "",
"productName": "门禁",
"nodeType": "设备",
"createTime": "2025-07-04 10:43:38",
"categoryName": "刷卡门禁",
"dataType": "标准数据格式",
"gatewayType": "否",
"networkType": "以太网",
"remark": "门禁",
"projectCode": ""
},
"count": 1
}
}
网络类型下拉列表
请求URL
https://www.thingshub.com.cn/openapi/v2/product/list-network
方法
GET
Content-Type
无
请求参数
参数 | 数据类型 | 必填 | 说明 |
---|---|---|---|
type | int | 是 | 0 公共网络 1 网关接入网络 |
响应参数
参数 | 数据类型 | 是否必填 | 说明 |
---|---|---|---|
code | int | 是 | 返回码 |
msg | string | 是 | 返回消息 |
data | array | 是 | 返回数据 |
+id | int | 是 | ID |
+type | int | 是 | 网络类型 |
+name | string | 是 | 网络类型名称 |
+remark | string | 是 | 备注 |
样例
{
"code": 200,
"msg": "success",
"data": [
{
"id": 4,
"type": 0,
"name": "蜂窝网络",
"remark": ""
},
{
"id": 5,
"type": 0,
"name": "WiFi",
"remark": ""
},
{
"id": 6,
"type": 0,
"name": "以太网",
"remark": ""
},
{
"id": 7,
"type": 0,
"name": "LoRaWAN",
"remark": ""
},
{
"id": 8,
"type": 0,
"name": "其他",
"remark": ""
}
]
}
产品分类下拉列表
请求URL
https://www.thingshub.com.cn/openapi/v2/product/list-category
方法
GET
Content-Type
无
请求参数
无
响应参数
参数 | 数据类型 | 是否必填 | 说明 |
---|---|---|---|
code | int | 是 | 返回码 |
msg | string | 是 | 返回消息 |
data | array | 是 | 返回数据 |
+level | int | 是 | 分类级别 |
+parentId | int | 是 | 父类型ID |
+orderId | int | 是 | 排序ID |
+pathName | string | 是 | 名称 |
+remark | string | 是 | 备注名称 |
+code | string | 是 | 分类编码 |
+value | int | 是 | 分类ID |
+label | string | 是 | 分类名称 |
+children | array | 否 | 子分类列表 |
样例
{
"code": 200,
"msg": "success",
"data": [
{
"level": 1,
"parentId": 103,
"orderId": 0,
"pathName": "智慧农业",
"remark": "智慧农业",
"code": "1.2",
"value": 115,
"label": "智慧农业",
"children": [
{
"level": 2,
"parentId": 115,
"orderId": 0,
"pathName": "智慧农业/养鸡",
"remark": "养鸡",
"code": "1.2.1",
"value": 116,
"label": "养鸡",
"children": [
{
"level": 3,
"parentId": 116,
"orderId": 0,
"pathName": "温湿度传感器",
"remark": "温湿度传感器",
"code": "1.2.1.1",
"value": 204,
"label": "温湿度传感器",
"children": []
}
]
}
]
}
]
}