简体中文
可见知识空间列表
约 616 字大约 2 分钟
2026-09-14
描述
查询当前用户可见(具有查看及以上权限)的知识空间列表。知识库按「知识空间 → 知识文件夹 → 知识条目」三级组织:知识空间是最顶层的容器,空间下有多级知识文件夹,知识条目归属于文件夹。对接时一般先调本接口拿到空间,再逐层查询文件夹与条目。
请求说明
请求方式 :POST + application/json
请求路径 :https://${填入所在云的域名}/cgi/crm/v2/knowledge/space/list?thirdTraceId=${随机字符串}
请求头填写 :参考公共参数填写
请求参数
本接口无业务参数,请求体中 data 传空对象即可。
请求示例
{
"data": {}
}返回参数
| 参数 | 类型 | 说明 |
|---|---|---|
| traceId | string | 请求唯一ID |
| errorDescription | string | 错误描述 |
| errorMessage | string | 错误信息 |
| errorCode | Int | 查看错误码 |
| data | object | 返回数据 |
| spaces | Array | 当前用户可见的知识空间列表 |
| spaces[].spaceId | String | 空间 ID |
| spaces[].name | String | 空间名称 |
| spaces[].description | String | 空间描述 |
| spaces[].coverImage | Array | 封面图片列表,元素结构不固定(仅作展示用途),无封面时为空数组 [] |
| spaces[].spaceType | String | 空间产品类型 |
| spaces[].spaceChannel | String | 空间渠道 |
| spaces[].spaceScope | String | 空间范围:personal 个人空间、enterprise 企业空间 |
| spaces[].order | Int | 排序号 |
| spaces[].state | String | 空间状态 |
| spaces[].permission | String | 当前用户对该空间的权限级别,取值见查询资源有效权限 |
| spaces[].createTime | Long | 创建时间,毫秒时间戳 |
| spaces[].updateTime | Long | 更新时间,毫秒时间戳 |
返回示例
{
"traceId": "E-O.fktest4234.1000-20260914115000-xxxxxx",
"errorDescription": "success",
"errorMessage": "success",
"errorCode": 0,
"data": {
"spaces": [
{
"spaceId": "space-001",
"name": "产品知识库",
"description": "产品相关资料",
"coverImage": [],
"spaceType": "1",
"spaceChannel": "enterprise",
"spaceScope": "enterprise",
"order": 1,
"state": "1",
"permission": "VIEW",
"createTime": 1757772000000,
"updateTime": 1757772000000
}
]
}
}注意事项
- 仅返回当前用户具有查看(VIEW)及以上权限的空间;无可见空间时
spaces为空数组。首次调用可能自动为当前用户初始化个人知识空间。 - 本接口一次性返回全部可见空间,无分页。排序规则为企业空间在前、个人空间在后,组内按
order升序。 - 区分个人空间与企业空间请使用
spaceScope字段,不要使用spaceType。 - 不能使用返回值的message字段做逻辑判断,errorMessage会有变化;
