创建产品

文档信息

字段 内容
关联产品 [[DTS]]
服务名称 Microservice-DigitalTwin-Center
接口类型 对外开放接口
协议类型 HTTP
当前版本 v1.0.0
维护人 产品组
适用对象 后端开发 / 第三方集成商

服务接口简介

调用该接口创建产品。

接口信息

项 内容
方法 POST
路径 /bv-microservice-digitaltwin-center/product/create
协议 HTTP
是否鉴权 是
幂等性 否
超时时间建议 5s

请求参数

请求体:

字段 类型 是否必填 说明 示例
addTime string(date-time) 否 - -
addUser string 否 - -
positionCoordinateSystemId integer(int32) 否 位置坐标系统编号 0
productAccessGatewayProtocol integer(int32) 否 接入网关协议 0 标准网关协议(HTTP) 1 自定义网关协议 0
productAuthenticationMethod integer(int32) 否 认证方式 0 设备密钥 0
productCategory integer(int32) 否 品类 0 自定义品类 1 标准品类 0
productDataFormat integer(int32) 否 数据格式 0 透传/自定义 1 标准数据格式(BV JSON) 0
productDescription string 否 产品描述 -
productId string 否 产品编号 -
productName string 否 产品名称 -
productNormCategoryId string 否 标准品类编号(选择自定义品类时为null) -
productSecret string 否 产品签名 -
productSourceType integer(int32) 否 资源类型 0 动态资源 1 静态资源(poi) 2 组合产品 0
templateId string 否 产品属性详情模板编号 -
updateTime string(date-time) 否 - -

请求体示例:

{
  "addTime": "",
  "addUser": "",
  "positionCoordinateSystemId": 0,
  "productAccessGatewayProtocol": 0,
  "productAuthenticationMethod": 0,
  "productCategory": 0,
  "productDataFormat": 0,
  "productDescription": "",
  "productId": "",
  "productName": "",
  "productNormCategoryId": "",
  "productSecret": "",
  "productSourceType": 0,
  "templateId": "",
  "updateTime": ""
}

响应参数

字段 类型 说明 示例
code integer(int32) 状态码 0
info object - {}
message string 响应消息 -

响应示例:

{
    "code": 0,
    "info": {},
    "message": ""
}

调用示例

curl 示例:

curl -X POST "http://<Host>/bv-microservice-digitaltwin-center/product/create" \
  -H "bv-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"addTime": "", "addUser": "", "positionCoordinateSystemId": 0, "productAccessGatewayProtocol": 0, "productAuthenticationMethod": 0, "productCategory": 0, "productDataFormat": 0, "productDescription": "", "productId": "", "productName": "", "productNormCategoryId": "", "productSecret": "", "productSourceType": 0, "templateId": "", "updateTime": ""}'

接口错误码

错误码 HTTP 状态 场景 处理建议
200 200 创建成功 (返回产品详情) 成功
201 201 Created (资源已创建) 创建成功
401 401 未授权 (需要认证信息) 请登录通用用户系统获取 API Key,并在 Header 中携带 bv-api-key
403 403 禁止访问 (权限不足) 请检查该 API Key 是否被授权访问该接口
404 404 接口不存在 (检查接口地址) 检查接口 URL 是否正确

备注

  • 前置条件:API Key 已在“通用用户系统”中创建并关联了相应的 DTS 权限。
  • 副作用:无。
作者:北京-产品-yantings  创建时间:2025-11-05 16:43
最后编辑:北京-产品-yantings  更新时间:2026-07-07 18:15
上一篇:
下一篇: