Skip to content

维度

获取维度列表

GET /openapi/v1/workspaces/{workspaceId}/dimensions/

{
  "errcode": 200,
  "errmsg": "success",
  "data": [
    {
      "id": 1,
      "type": "str",
      "format": "",
      "displayName": {
        "zh-CN": "维度展示名",
        "en-US": "Dimension display name"
      },
      "rating": 5,
      "names": ["维度"],
      "description": "",
      "isKeyword": true,
      "autoGroup": true,
      "baseField": {
        "choice": {
          "0": "否",
          "1": "是"
        },
        "typeBeforeMap": "str",
        "typeAfterMap": "str"
      },
      "enableSubDimensionExplorer": true,
      "keywordFilters": [],
      "subDimensions": [{ "prop": "d2" }],
      "models": [
        {
          "uid": "模型 uid",
          "name": "模型名称"
        }
      ],
      "used": true
    }
  ]
}
字段 类型 说明
data.id int 维度 id
data.type string 维度数据类型
data.format string 维度展示类型
data.displayName dict 维度的多语言展示名称,键为语言代码
data.rating int 维度评分
data.names list 维度关键词和别名列表,第一个为关键词,其他为别名
data.description string 维度说明
data.isKeyword bool 是否作为关键词
data.autoGroup bool 是否自动分组
data.baseField dict 当维度数据类型为映射类型, 包含该字段
data.baseField.choice dict 映射关系表
data.baseField.typeBeforeMap string 映射前类型
data.baseField.typeAfterMap string 映射后类型
data.enableSubDimensionExplorer bool 自动展示子维度卡片
data.keywordFilters list 同步维度关键词时的过滤条件
data.subDimensions list 子维度列表
data.models list 被引用的模型列表
data.used bool 维度是否被引用

获取维度详情

GET /openapi/v1/workspaces/{workspaceId}/dimensions/{dimensionId}/

返回值与获取维度列表中的单个 data 对象一致,包含 displayName。

批量创建维度

POST /openapi/v1/workspaces/{workspaceId}/dimensions/create-dimensions/

请求体

{
  "dimensions": [
    {
      "type": "str",
      "format": "",
      "rating": 5,
      "names": ["维度"],
      "description": "",
      "isKeyword": true,
      "autoGroup": true,
      "baseField": {
        "choice": {
          "0": "否",
          "1": "是"
        },
        "typeBeforeMap": "str",
        "typeAfterMap": "str"
      },
      "enableSubDimensionExplorer": true,
      "keywordFilters": [],
      "subDimensions": [{ "prop": "d2" }]
    }
  ]
}
字段 类型 是否必填 说明
type string 是 维度数据类型
format string 是 维度展示格式
rating int 否 维度评分
names list 是 维度名称
description string 否 维度说明
isKeyword bool 否 是否作为关键词
autoGroup bool 否 是否自动分组
baseField dict 否 当数据类型为映射类型时, 该字段必填
baseField.choice dict 否 当数据类型为映射类型时, 该字段必填
baseField.typeBeforeMap string 否 当数据类型为映射类型时, 该字段必填
baseField.typeAfterMap string 否 当数据类型为映射类型时, 该字段必填
enableSubDimensionExplorer bool 否 自动展示子维度卡片
keywordFilters list 否 同步维度关键词时的过滤条件
subDimensions list 否 子维度列表

返回值

{
  "errcode": 200,
  "errmsg": "success",
  "data": [
    {
      "id": 1,
      "type": "str",
      "format": "",
      "displayName": {
        "zh-CN": "维度展示名",
        "en-US": "Dimension display name"
      },
      "rating": 5,
      "names": ["维度"],
      "description": "",
      "isKeyword": true,
      "autoGroup": true,
      "baseField": {
        "choice": {
          "0": "否",
          "1": "是"
        },
        "typeBeforeMap": "str",
        "typeAfterMap": "str"
      },
      "enableSubDimensionExplorer": true,
      "keywordFilters": [],
      "subDimensions": [{ "prop": "d2" }],
      "models": [
        {
          "uid": "模型 uid",
          "name": "模型名称"
        }
      ],
      "used": true
    }
  ]
}

批量编辑维度

PUT /openapi/v1/workspaces/{workspaceId}/dimensions/update-dimensions/

请求体

{
  "measures": [
    {
      "id": 1,
      "type": "str",
      "format": "",
      "displayName": {
        "zh-CN": "维度展示名",
        "en-US": "Dimension display name"
      },
      "rating": 5,
      "names": ["维度"],
      "description": "",
      "isKeyword": true,
      "autoGroup": true,
      "baseField": {
        "choice": {
          "0": "否",
          "1": "是"
        },
        "typeBeforeMap": "str",
        "typeAfterMap": "str"
      },
      "enableSubDimensionExplorer": true,
      "keywordFilters": [],
      "subDimensions": [{ "prop": "d2" }]
    }
  ]
}
字段 类型 是否必填 说明
id int 是 维度 id
type string 是 维度数据类型
format string 是 维度展示格式
rating int 否 维度评分
names list 是 维度名称
description string 否 维度说明
isKeyword bool 否 是否作为关键词
autoGroup bool 否 是否自动分组
baseField dict 否 当数据类型为映射类型时, 该字段必填
baseField.choice dict 否 当数据类型为映射类型时, 该字段必填
baseField.typeBeforeMap string 否 当数据类型为映射类型时, 该字段必填
baseField.typeAfterMap string 否 当数据类型为映射类型时, 该字段必填
enableSubDimensionExplorer bool 否 自动展示子维度卡片
keywordFilters list 否 同步维度关键词时的过滤条件
subDimensions list 否 子维度列表

返回值

{
  "errcode": 200,
  "errmsg": "success",
  "data": [
    {
      "id": 1,
      "type": "str",
      "format": "",
      "rating": 5,
      "names": ["维度"],
      "description": "",
      "isKeyword": true,
      "autoGroup": true,
      "baseField": {
        "choice": {
          "0": "否",
          "1": "是"
        },
        "typeBeforeMap": "str",
        "typeAfterMap": "str"
      },
      "enableSubDimensionExplorer": true,
      "keywordFilters": [],
      "subDimensions": [{ "prop": "d2" }],
      "models": [
        {
          "uid": "模型 uid",
          "name": "模型名称"
        }
      ],
      "used": true
    }
  ]
}

批量删除维度

DELETE /openapi/v1/workspaces/{workspaceId}/dimensions/delete-dimensions/

请求体

{
  "dimensionIds": [1, 2]
}

返回值

{
  "errcode": 200,
  "errmsg": "success"
}