# 查询任务详情

请求URL

GET https://lxapi.lexiangla.com/cgi-bin/v1/tasks/{task_id}

请求头

参数 是否必须 说明
Authorization 接口调用凭证 access_token
值格式:"Bearer access_token"
示例值:"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJS"

其他说明

事项 说明
权限要求 任务管理
频率限制 3000次/分钟

参数说明

参数 是否必须 说明
task_id 任务ID
include 包含的关联,不传则不返回,支持传入followers和members,传入多个要用“,”隔开(followers,members)

响应

200 OK 状态码

{
  "data": {
    "type": "task",
    "id": "e6f68cb41fad11ea91d40242c0a83004",
    "attributes": {
      "title": "任务标题",
      "type": "reading",
      "content": "任务详情描述",
      "target_type": "kb_entry",
      "target_id": "文档ID",
      "entity_type": "kb_entry",
      "entity_id": "文档ID",
      "due_at": 1672531200,
      "created_at": 1672531200,
      "updated_at": 1672531300,
      "closed_at": 0,
      "total_staff_count": 1,
      "finished_staff_count": 1
    },
    "relationships": {
      "followers": {
        "data": [
          {
            "type": "task_follower",
            "id": "任务关注人记录ID"
          }
        ]
      },
      "members": {
        "data": [
          {
            "type": "task_member",
            "id": "任务处理人记录ID1"
          },
          {
            "type": "task_member",
            "id": "任务处理人记录ID2"
          }
        ]
      },
      "owner": {
        "data": {
          "type": "staff",
          "id": "任务创建人ID"
        }
      }
    }
  },
  "included": [
    {
      "type": "task_member",
      "id": "任务处理人记录ID",
      "attributes": {
        "target_type": "staff",
        "target_id": "任务处理人ID"
      }
    },
    {
      "type": "task_member",
      "id": "任务处理人记录ID",
      "attributes": {
        "target_type": "department",
        "target_id": "任务处理人部门ID"
      }
    },
    {
      "type": "task_follower",
      "id": "任务关注人记录ID",
      "attributes": {
        "target_type": "staff",
        "target_id": "任务关注人ID"
      }
    },
    {
      "type": "staff",
      "id": "任务创建人ID",
      "attributes": {
        "name": "任务创建人姓名",
        "english_name": "任务创建人英文名",
        "organization": "任务创建人组织架构"
      }
    }
  ]
}

参数说明

参数 说明
data.id 任务ID
data.attributes.title 任务标题
data.attributes.type 任务类型
- reading: 阅读任务
- collaboration: 协作任务
data.attributes.content 任务详情描述
data.attributes.target_type 关联对象类型
- kb_entry: 知识库文档
- collaboration_task: 协作任务
data.attributes.target_id 关联对象ID
data.attributes.entity_type 关联实体类型
- kb_entry: 知识库文档
data.attributes.entity_id 关联实体ID
data.attributes.due_at 任务截止时间(Unix时间戳)
data.attributes.created_at 任务创建时间(Unix时间戳)
data.attributes.updated_at 任务最后更新时间(Unix时间戳)
data.attributes.closed_at 任务关闭时间(Unix时间戳),未关闭为0
data[].attributes.total_staff_count 任务总参与人数
data[].attributes.finished_staff_count 已完成任务的人数
data.relationships.owner.data.id 任务创建人ID
data.relationships.members.data[].id 任务成员记录的ID(可以用于匹配included中type为task_member的属性)
data.relationships.followers.data[].id 任务关注成员记录的ID(可以用于匹配included中type为task_follower的属性)
included[].id 对应资源类型的ID,比如type是staff就对应成员的ID,type为task_staff则对应成员记录的ID
included[].attributes.name 任务创建人名称
included[].attributes.english_name 任务创建人英文名称
included[].attributes.organization 任务创建任组织架构
included[].attributes.target_id 处理人ID(需结合类型判断)
included[].attributes.target_type 处理人类型
- staff: 成员类型
- department: 部门类型