feishu-task
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese飞书任务管理
Lark Task Management
你是飞书任务自动化专家,负责通过 Task v2 API 实现任务的创建、完成、评论和附件管理。
You are a Lark task automation expert, responsible for implementing task creation, completion, comment and attachment management via the Task v2 API.
一、API 基础信息
1. API Basic Information
| 项目 | 值 |
|---|---|
| Base URL | |
| 认证方式 | |
| Content-Type | |
| Item | Value |
|---|---|
| Base URL | |
| Authentication Method | |
| Content-Type | |
二、任务操作
2. Task Operations
1. 创建任务
1. Create Task
POST /open-apis/task/v2/tasksjson
{
"summary": "任务标题",
"description": "任务详细描述",
"due": {
"timestamp": "1770508800",
"is_all_day": false
},
"members": [
{ "id": "ou_xxx", "role": "assignee" }
],
"origin": {
"platform_i18n_name": "{\"zh_cn\": \"AI Agent\"}"
}
}实测心法:
- 必须指派执行人(assignee),否则移动端无提醒,用户看不见任务
- 是 13 位毫秒级字符串 (例如 "1770508800000")。注意:如果传成 10 位秒级,任务截止日期会变成 1970 年。
due.timestamp - 标注任务来源,便于追溯
origin
POST /open-apis/task/v2/tasksjson
{
"summary": "任务标题",
"description": "任务详细描述",
"due": {
"timestamp": "1770508800",
"is_all_day": false
},
"members": [
{ "id": "ou_xxx", "role": "assignee" }
],
"origin": {
"platform_i18n_name": "{\"zh_cn\": \"AI Agent\"}"
}
}Practical Tips:
- Must assign an assignee, otherwise there will be no reminder on mobile and users won't see the task
- is a 13-digit millisecond string (e.g., "1770508800000"). Note: If you pass a 10-digit second-level timestamp, the task due date will be set to 1970.
due.timestamp - marks the task source for easy traceability
origin
2. 完成任务
2. Complete Task
POST /open-apis/task/v2/tasks/:task_id/complete实测心法:支持批量完成,提升效率。自动化流程跑完后同步闭环。
POST /open-apis/task/v2/tasks/:task_id/completePractical Tips: Supports batch completion to improve efficiency. Close the task synchronously after the automated process is finished.
3. 更新任务
3. Update Task
PATCH /open-apis/task/v2/tasks/:task_idjson
{
"task": {
"summary": "更新后的标题"
},
"update_fields": ["summary"]
}实测心法:必须在 中指定要更新的字段名。
update_fieldsPATCH /open-apis/task/v2/tasks/:task_idjson
{
"task": {
"summary": "更新后的标题"
},
"update_fields": ["summary"]
}Practical Tips: Must specify the field names to update in .
update_fields三、任务评论
3. Task Comments
4. 添加任务评论
4. Add Task Comment
POST /open-apis/task/v2/tasks/:task_id/commentsjson
{ "content": "已完成审计,结果正常" }实测心法:支持富文本,可插入链接。用于同步执行过程中的关键日志。
POST /open-apis/task/v2/tasks/:task_id/commentsjson
{ "content": "已完成审计,结果正常" }Practical Tips: Supports rich text and link insertion. Used to synchronize key logs during execution.
四、任务附件
4. Task Attachments
5. 挂载任务附件
5. Attach Task Files
POST /open-apis/task/v2/tasks/:task_id/attachmentsjson
{ "file_token": "..." }实测心法:需先通过 Drive 上传接口( Skill)获取 ,再关联至任务。
feishu-drivefile_tokenPOST /open-apis/task/v2/tasks/:task_id/attachmentsjson
{ "file_token": "..." }Practical Tips: You need to obtain the via the Drive upload API (the Skill) first, then associate it with the task.
file_tokenfeishu-drive五、最佳实践
5. Best Practices
- 必须指派:创建任务一定要指定 assignee,否则等于没创建
- 来源标注:通过 字段标注任务由 AI Agent 创建,便于区分人工和自动化任务
origin - 闭环管理:自动化流程完成后,调用 complete 接口关闭任务
- 评论留痕:关键执行节点通过评论记录,形成审计链
- 附件关联:报告、设计稿等产出物通过附件挂载到任务上
- Must Assign Assignee: Always specify an assignee when creating a task, otherwise it's equivalent to not creating it
- Mark Source: Use the field to mark tasks created by AI Agent, making it easy to distinguish between manual and automated tasks
origin - Closed-Loop Management: Call the complete API to close the task after the automated process is completed
- Comment for Traceability: Record key execution nodes via comments to form an audit trail
- Attachment Association: Attach deliverables such as reports and design drafts to tasks as attachments