乐享知识库接口文档 请求URL
GET https://lxapi.lexiangla.com/cgi-bin/v1/tasks
请求头
| 参数 | 是否必须 | 说明 |
|---|---|---|
| Authorization | 是 | 接口调用凭证 access_token 值格式:"Bearer access_token" 示例值:"Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJS" |
其他说明
| 事项 | 说明 |
|---|---|
| 权限要求 | 任务管理 |
| 频率限制 | 3000次/分钟 |
参数说明
| 参数 | 是否必须 | 说明 |
|---|---|---|
| staff_id | 是 | 被查询者员工ID |
| type | 否 | 任务类型 - reading: 阅读任务- collaboration: 协作任务 |
| status | 否 | 任务完成状态 - 0: 未完成- 2: 已完成 |
| target_type | 否 | 关联对象类型 - kb_entry: 知识库文档- collaboration_task: 协作任务 |
| target_id | 否 | 关联对象ID |
| entity_type | 否 | 关联实体类型 - kb_entry: 知识库文档 |
| entity_id | 否 | 关联实体ID |
| page_token | 否 | 用于分页,从响应的meta.page_token获取 |
| limit | 否 | 每页拉取条数,默认20;最大100 |
响应
200 OK 状态码
{
"data": [
{
"type": "task",
"id": "bc0cb124417e45388b5b126cab12f566",
"attributes": {
"title": "任务标题1",
"type": "reading",
"content": "任务详情描述1",
"target_type": "kb_entry",
"target_id": "文档ID1",
"entity_type": "kb_entry",
"entity_id": "文档ID1",
"due_at": 1767974399,
"created_at": 1767855431,
"updated_at": 1767949454,
"closed_at": 0,
"total_staff_count": 1,
"finished_staff_count": 1
},
"relationships": {
"owner": {
"data": {
"type": "staff",
"id": "任务创建人成员ID"
}
},
"staff": {
"data": {
"type": "task_staff",
"id": "任务成员记录ID"
}
}
}
}
],
"included": [
{
"type": "staff",
"id": "任务创建人ID",
"attributes": {
"name": "任务创建人姓名",
"english_name": "任务创建人英文名",
"organization": "任务创建人组织架构"
}
},
{
"type": "task_staff",
"id": "任务成员记录ID ",
"attributes": {
"staff_id": "任务成员ID",
"status": 0,
"completed_at": 0
}
}
],
"meta": {
"page_token": "WyIyMDI2LTAxLTA4VDE0OjU3OjExKzA4OjAwIiw1ODI2N10"
}
}
参数说明
| 参数 | 说明 |
|---|---|
| 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.staff.data.id | 任务成员记录的ID(可以用于匹配included中type为task_staff的属性) |
| included[].id | 对应资源类型的ID,比如type是staff就对应成员的ID,type为task_staff则对应成员记录的ID |
| included[].attributes | 对应类型的属性 |
| included[].attributes.name | 任务创建人名称 |
| included[].attributes.english_name | 任务创建人英文名称 |
| included[].attributes.organization | 任务创建人组织架构 |
| included[].attributes.staff_id | 任务成员ID |
| included[].attributes.status | 任务成员任务状态 - 0: 未完成- 2: 已完成 |
| included[].attributes.completed_at | 任务成员完成任务时间(Unix时间戳),未完成为0 |
| meta.page_token | 下一页的分页page_token |