按 taskId 查询已执行强制下线任务的详情,包括任务状态、执行范围和执行结果。
- Scope:
admin.v1.force-logout-tasks.read - 权限项: 强制下线任务读取
- 权限类型: read
- 接口: GET
/api/openapi/v1/force-logout-tasks/{taskId}
Authorization: Bearer <API_KEY>。应用必须配置“全部用户”范围(subject_scope={"mode":"all"});受限或无效范围在业务执行前返回 403 openapi_subject_scope_denied。各 Scope 独立授权,互不隐含。组织及应用操作主体取自可信鉴权,不接受请求参数指定。
仅查询已执行任务及持久化目标用户快照。executed 表示下线命令已生成,不代表客户端已经收到或完成下线。
请求参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
taskId | path | string | True | 下线任务标识 |
请求示例
响应字段
| 名称 | 类型 | 说明 |
|---|---|---|
created_at | string | 创建时间 |
created_by | string | 创建主体标识 |
created_by_email | string | 创建主体邮箱 |
created_by_name | string | 创建主体名称 |
executed_at | string | 命令生成时间 |
execution_mode | string | 立即或定时执行模式;enum=['immediate', 'scheduled'] |
expires_at | string | 命令过期时间 |
id | string | 记录标识 |
prompt | string | 下线提示语 |
reason | string | 申请或任务原因 |
scheduled_at | string | 计划执行时间 |
scope_type | string | 作用范围类型;enum=['all', 'specified'] |
status | string | 申请或任务状态;enum=['pending', 'executed'] |
subjects | array | 作用范围对象 |
subjects[].id | string | 记录标识 |
subjects[].name | string | 名称;maxLength=255 |
subjects[].type | string | 对象类型;enum=['department', 'user_group', 'user'] |
target_client | string | 目标客户端,固定 pc;enum=['pc'] |
updated_at | string | 更新时间 |
updated_by | string | 更新主体标识 |
updated_by_email | string | 更新主体邮箱 |
updated_by_name | string | 更新主体名称 |
version | integer | 并发控制版本 |
错误处理
沿用 {error, detail, code} 错误结构。身份校验失败为 401/403;缺少 Scope 或非全部用户范围为 403;资源不存在为 404;冲突或旧版本为 409;参数不合法为 400/422;依赖不可用为 503。业务错误沿用控制台语义。