Skip to main content

查询已执行下线任务详情接口

按 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 表示下线命令已生成,不代表客户端已经收到或完成下线。

请求参数

名称位置类型必填说明
taskIdpathstringTrue下线任务标识

请求示例

curl --request GET 'https://example.invalid/api/openapi/v1/force-logout-tasks/11111111-1111-4111-8111-111111111111' \
  --header 'Authorization: Bearer <API_KEY>'

响应字段

名称类型说明
created_atstring创建时间
created_bystring创建主体标识
created_by_emailstring创建主体邮箱
created_by_namestring创建主体名称
executed_atstring命令生成时间
execution_modestring立即或定时执行模式;enum=['immediate', 'scheduled']
expires_atstring命令过期时间
idstring记录标识
promptstring下线提示语
reasonstring申请或任务原因
scheduled_atstring计划执行时间
scope_typestring作用范围类型;enum=['all', 'specified']
statusstring申请或任务状态;enum=['pending', 'executed']
subjectsarray作用范围对象
subjects[].idstring记录标识
subjects[].namestring名称;maxLength=255
subjects[].typestring对象类型;enum=['department', 'user_group', 'user']
target_clientstring目标客户端,固定 pc;enum=['pc']
updated_atstring更新时间
updated_bystring更新主体标识
updated_by_emailstring更新主体邮箱
updated_by_namestring更新主体名称
versioninteger并发控制版本

错误处理

沿用 {error, detail, code} 错误结构。身份校验失败为 401/403;缺少 Scope 或非全部用户范围为 403;资源不存在为 404;冲突或旧版本为 409;参数不合法为 400/422;依赖不可用为 503。业务错误沿用控制台语义。

接口语义与安全边界

仅支持已执行任务。待执行的定时任务在此接口返回 404;请使用已有任务列表查询待执行任务。此接口既不触发任务,也不提供客户端下线回执。