Skip to content

产品管理 ​

产品创建 ​

请求URL

https://www.thingshub.com.cn/openapi/v2/product/save

方法

POST

Content-Type

application/x-www-form-urlencoded

请求参数

参数数据类型必填说明
projectCodestring否项目编码
nodeTypeint是节点类型
gatewayTypeint是是否加入网关
categoryIdstring是产品分类ID
networkTypeint否联网方式
dataTypeint否数据格式类型
productNamestring是产品名称
remarkstring否备注

响应参数

参数数据类型必填说明
codeint是返回码
msgstring是返回消息
dataobject是返回数据
idint是产品ID
projectCodestring是项目编码
productKeystring是ProductKey
productNamestring是产品名称
nodeTypeint是节点类型
gatetwayTypeint是是否接入网关
categoryIdstring是产品分类ID
networkTypeint是联网方式
dataTypeint是数据格式类型
createTimestring是创建时间
remarkstring是备注

节点类型 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 非标准

响应样例

json
{
  "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

无

请求参数

参数数据类型必填说明
projectCodestring是项目编码

响应参数

参数数据类型必填说明
codeint是返回码
msgstring是返回消息
dataarray是返回数据
+idint是产品ID
+projectCodestring是项目编码
+productKeystring是ProductKey
+nodeTypeint是节点类型
+gatewayTypeint是是否接入网关
+networkTypeint是连网类型
+productNamestring是产品名称
+createTimestring是创建时间
+remarkstring是备注
+dataTypeint是是否标准数据格式

样例

json
{
  "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

无

请求参数

参数数据类型必填说明
productIdint是产品ID

响应参数

参数数据类型必填说明
codeint是返回码
msgstring是返回消息
dataarray是返回数据
+productobject是产品信息
++idint是产品ID
++projectCodestring是项目编码
++productKeystring是ProductKey
++nodeTypestring是节点类型
++gatewayTypestring是是否接入网关
++networkTypestring是连网类型
++productNamestring是产品名称
++categoryNamestring是分类名称
++createTimestring是创建时间
++remarkstring是备注
++dataTypestring是是否标准数据格式
+countint是设备数

样例

json
{
  "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

无

请求参数

参数数据类型必填说明
typeint是0 公共网络 1 网关接入网络

响应参数

参数数据类型是否必填说明
codeint是返回码
msgstring是返回消息
dataarray是返回数据
+idint是ID
+typeint是网络类型
+namestring是网络类型名称
+remarkstring是备注

样例

json
{
  "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

无

请求参数

无

响应参数

参数数据类型是否必填说明
codeint是返回码
msgstring是返回消息
dataarray是返回数据
+levelint是分类级别
+parentIdint是父类型ID
+orderIdint是排序ID
+pathNamestring是名称
+remarkstring是备注名称
+codestring是分类编码
+valueint是分类ID
+labelstring是分类名称
+childrenarray否子分类列表

样例

json
{
  "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": []
            }
          ]
        }
      ]
    }
  ]
}