查询连接器策略组,查看允许或限制模式、人员范围、资源范围及启用状态。返回组标识和范围数量,用于核对已有授权配置。
所需权限
| 所需权限 | 资源 | Scope | 资源服务 |
|---|
| 连接器读取(读取) | connectors | admin.v1.connectors.read | qwenwork-biz-service |
GET /api/openapi/v1/connector-policies
认证与请求头
使用应用 API Key 调用。当前接口校验上方独立 Scope;读取、管理与执行权限互不包含。
| 名称 | 位置 | 类型 | 必填 | 说明 | 示例 |
|---|
| Authorization | header | string | 是 | 应用 API Key,使用 Bearer 方式传递。 | Bearer qwk_\\* |
| X-Request-Id | header | string | 否 | 可选的调用追踪标识;未传入时由服务端生成。 | req-20260831-001 |
请求参数
| 名称 | 位置 | 类型 | 必填 | 说明 | 示例 |
|---|
| keyword | query | string | 否 | 用于筛选此列表的搜索关键词。 | "<string>" |
| page | query | integer · int64 | 否 | 请求的页码,从 1 开始。 默认值:1。 最小值:1。 | 1 |
| page_size | query | integer · int64 | 否 | 每页返回的记录数量。 默认值:20。 最小值:1。 最大值:100。 | 20 |
请求示例
将 <BASE_URL> 替换为企业部署的千问办公 API 服务地址,并填写实际参数。示例中的占位值不能直接用于请求。
curl --request GET --url '<BASE_URL>/api/openapi/v1/connector-policies?keyword=<keyword>&page=1&page_size=20' --header 'Authorization: Bearer <API_KEY>'
响应
200 请求成功,返回当前或更新后的数据。
| 名称 | 类型 | 必填 | 说明 | 示例 |
|---|
| items | array | null | 是 | 符合查询条件的当前页记录列表。 | [{"created_at":"2026-08-27T10:00:00Z","default":false,"description":"<string>","id":"<string>","mode":"<string>","name":"<string>","policy_type":"<string>","resource_count":0,"resource_scope":"<string>","status":"<string>","subject_count":0,"subject_counts":{},"subject_scope":"<string>","surfaces":["<string>"],"updated_at":"2026-08-27T10:00:00Z"}] |
| items[].created_at | string · date-time | 是 | 此记录的创建时间。 | "2026-08-27T10:00:00Z" |
| items[].default | boolean | 是 | 是否为默认策略组。 | false |
| items[].description | string | 是 | 资源策略组的用途说明。 | "<string>" |
| items[].id | string | 是 | 此记录的唯一标识,查询、更新或删除对应记录时使用。 | "<string>" |
| items[].mode | string | 是 | 策略模式:allowlist 为允许所选资源,denylist 为限制所选资源。 | "<string>" |
| items[].name | string | 是 | 资源策略组的名称。 | "<string>" |
| items[].policy_type | string | 是 | 策略组管理的资源类型。 | "<string>" |
| items[].resource_count | integer · int64 | 是 | 策略所选资源的数量。 | 0 |
| items[].resource_scope | string | 是 | 资源范围:all 为全部资源,selected 为指定资源。 | "<string>" |
| items[].status | string | 是 | 此记录当前所处的状态。 | "<string>" |
| items[].subject_count | integer · int64 | 是 | 策略所选范围对象的数量。 | 0 |
| items[].subject_counts | object | 是 | 按对象类型统计的策略范围对象数量。 | {} |
| items[].subject_scope | string | 是 | 用户范围:all_users 为所有用户,selected 为指定对象。 | "<string>" |
| items[].surfaces | array | null | 是 | 策略适用的入口,当前仅支持 qwenwork_pc;未填写时使用该入口。 | ["<string>"] |
| items[].updated_at | string · date-time | 是 | 此记录最后一次更新的时间。 | "2026-08-27T10:00:00Z" |
| page | integer · int64 | 是 | 当前结果页的页码,从 1 开始。 | 0 |
| page_size | integer · int64 | 是 | 每页返回的记录数。 | 0 |
| total_items | integer · int64 | 是 | 符合查询条件的记录总数。 | 0 |
| total_pages | integer · int64 | 是 | 按当前每页数量计算的总页数。 | 0 |
{
"items": [
{
"created_at": "2026-08-27T10:00:00Z",
"default": false,
"description": "<string>",
"id": "<string>",
"mode": "<string>",
"name": "<string>",
"policy_type": "<string>",
"resource_count": 0,
"resource_scope": "<string>",
"status": "<string>",
"subject_count": 0,
"subject_counts": {},
"subject_scope": "<string>",
"surfaces": [
"<string>"
],
"updated_at": "2026-08-27T10:00:00Z"
}
],
"page": 0,
"page_size": 0,
"total_items": 0,
"total_pages": 0
}
default 请求失败,返回错误码和错误详情。
| 名称 | 类型 | 必填 | 说明 | 示例 |
|---|
| code | string | 否 | 用于程序判断错误原因的稳定业务错误码。 | "<string>" |
| detail | string | 是 | 便于阅读的错误说明。 | "<string>" |
| details | OpenapiErrorDetails | 否 | 字段校验失败时的详细信息。 | {"field":"<string>","reason":"<string>","suggestion":"<string>"} |
| details.field | string | 否 | 未通过校验的请求字段。 | "<string>" |
| details.reason | string | 否 | 稳定的校验失败原因,用于判断字段为何不合法。 | "<string>" |
| details.suggestion | string | 否 | 建议采用的规范化字段值。 | "<string>" |
| error | string | 是 | 稳定的 HTTP 错误类型。 | "<string>" |
{
"code": "<string>",
"detail": "<string>",
"details": {
"field": "<string>",
"reason": "<string>",
"suggestion": "<string>"
},
"error": "<string>"
}