Skip to content

产品管理

产品创建

请求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": []
            }
          ]
        }
      ]
    }
  ]
}