遍历产品模版

  1. 请求地址:GET /products/{productName}/templates

  2. 接口概述:

    遍历指定产品的模版数据。

  3. 请求参数:

    参数名 参数类型 参数说明 必需 备注
    offset integer 响应结果起始下标 默认0
    limit integer 响应结果的数量 默认50,最大1000

    如何遍历?

    地址参数

    参数名 参数类型 参数说明 必需 备注
    productName string 产品名
  4. 请求体:

  5. 请求示例:

    GET /bitanswer/api/products/{productName}/templates?limit=1 HTTP/1.1
    Host: back-office-api.bitanswer.cn
    bitkey: ••••••
  6. 响应示例:

    {
       "status": 0,
       "data": {
           "total": 1,
           "items": [
               {
                   "regDate": "2023-08-16 15:51:44",
                   "name": "Default",
                   "status": 0
               }
           ]
       }
    }

    响应体说明

查询模版特征项

  1. 请求地址:

    • POST /products/{productName}/templates/{templateName}/features/data
    • POST /products/ref/{refId}/templates/{templateName}/features/data
  2. 接口概述:

    指定产品与模版,根据限定的条件查询、排序模版下符合的特征项。

  3. 请求参数:

    参数名 参数类型 参数说明 必需 备注
    offset integer 响应结果起始下标 默认0
    limit integer 响应结果的数量 默认50,最大1000

    如何遍历?

    地址参数

    参数名 参数类型 参数说明 必需 备注
    productName string 产品名
    templateName string 模板名
  4. 请求体:

    参数名 参数类型 参数说明 必需 备注
    querys array 查询参数
    sorts array 排序参数

    如何查询?

    querys

    支持:guidnamestatus

    sorts

    支持:idnamefeatureIdversionstatus

    响应体说明

  5. 请求示例:

    使用产品名与模版名,获取指定产品的指定模版,根据限定的条件查询、排序符合的特征项:

    POST /bitanswer/api/products/{productName}/templates/{templateName}/features/data?limit=1 HTTP/1.1
    Host: back-office-api.bitanswer.cn
    bitkey: ••••••
    
    {
      "querys": [
          {
              "name": "name",
              "op": "like",
              "values": [
                  "foo"
              ]
          }
      ],
      "sorts": [
          {
              "name": "name"
          }
      ]
    }

    使用产品引用id与模版名,获取指定产品的指定模版,根据限定的条件查询、排序符合的特征项:

    POST /bitanswer/api/products/ref/{refId}/templates/{templateName}/features/data?limit=1 HTTP/1.1
    Host: back-office-api.bitanswer.cn
    bitkey: ••••••
    
    {
      "querys": [
          {
              "name": "name",
              "op": "like",
              "values": [
                  "foo"
              ]
          }
      ],
      "sorts": [
          {
              "name": "name"
          }
      ]
    }
  6. 响应示例:

    {
      "status": 0,
      "data": {
          "total": 1,
          "items": [
              {
                  "id": 1,
                  "guid": "xxx",
                  "name": "foo",
                  "featureId": 1,
                  "value": 0,
                  "source": "PRODUCT",
                  "hidden": false,
                  "display": false,
                  "online": false,
                  "overwrite": true,
                  "ignoreSnUser": false,
                  "status": 3,
                  "type": "ReadOnly"
              }
          ]
      }
    }

    响应体说明

添加模版

  1. 请求地址:POST /products/{productName}/templates

  2. 接口概述:

    在指定产品下添加模版数据。

  3. 请求参数:

    地址参数

    参数名 参数类型 参数说明 必需 备注
    productName string 产品名
  4. 请求体:

    参数名 参数类型 参数说明 必需 备注
    name string 模版名称 模版名称不能超过32个字符
    description string 模版说明
  5. 请求示例:

    POST /bitanswer/api/products/{productName}/templates HTTP/1.1
    Host: back-office-api.bitanswer.cn
    bitkey: ••••••
    
    {
       "name":"demo_template",
       "description": "This is description."
    }
  6. 响应示例:

    {
       "status": 0,
       "data": {
           "total": 1,
           "items": [
               {
                   "regDate": "2025-09-19 15:46:27",
                   "name": "demo_template",
                   "status": 0,
                   "description": "This is description."
               }
           ]
       }
    }

    响应体说明

查询产品指定模版

  1. 请求地址: GET /products/{productName}/templates/{templateName}

  2. 接口概述:

    在指定产品下查询指定的模版数据。

  3. 请求参数:

    地址参数

    参数名 参数类型 参数说明 必需 备注
    productName string 产品名
    templateName string 模版名
  4. 请求体:

  5. 请求示例:

    GET /products/{productName}/templates/{templateName} HTTP/1.1
    Host: back-office-api.bitanswer.cn
    bitkey: ••••••
  6. 响应示例:

    {
       "status": 0,
       "data": {
           "total": 1,
           "items": [
               {
                   "regDate": "2025-09-19 15:46:27",
                   "name": "demo_template",
                   "status": 0,
                   "description": "This is description."
               }
           ]
       }
    }

    响应体说明

更新产品指定模版

  1. 请求地址:

    • PATCH /products/{productName}/templates/{templateName}

    • POST /products/{productName}/templates/{templateName}

  2. 接口概述:

    在指定产品下修改指定的模版数据。

    PATCH 方法仅更新输入的内容;

    POST 方法除输入的内容外,未输入的内容按默认值处理,适用于重置数据。

  3. 请求参数:

    地址参数

    参数名 参数类型 参数说明 必需 备注
    productName string 产品名
    templateName string 模版名
  4. 请求体:

    参数名 参数类型 参数说明 必需 备注
    name string 业务名称 模版名称不能超过32个字符
    description string 业务说明
  5. 请求示例:

    PATCH /products/{productName}/templates/{templateName} HTTP/1.1
    Host: back-office-api.bitanswer.cn
    bitkey: ••••••
    
    {
       "name":"demo_template",
       "description": "修改描述"
    }
  6. 响应示例:

    {
       "status": 0,
       "data": {
           "total": 1,
           "items": [
               {
                   "regDate": "2025-09-19 15:46:27",
                   "name": "demo_template",
                   "status": 0,
                   "description": "修改描述"
               }
           ]
       }
    }

    响应体说明

删除产品指定模版

  1. 请求地址: DELETE /products/{productName}/templates/{templateName}

  2. 接口概述:

    在指定产品下删除指定的模版数据。模版下存在SN时删除会报错。

  3. 请求参数:

    地址参数

    参数名 参数类型 参数说明 必需 备注
    productName string 产品名
    templateName string 模版名
  4. 请求体:

  5. 请求示例:

    DELETE /products/{productName}/templates/{templateName} HTTP/1.1
    Host: back-office-api.bitanswer.cn
    bitkey: ••••••
  6. 响应示例:

    {
       "status": 0,
       "data": {
           "total": 1,
           "items": [
               {
                   "name":"demo_template"
               }
           ]
       }
    }

    响应体说明