更新任务
PATCH
/open-apis/task/v1/tasks/{task_id}
自建应用商店应用
错误码
HTTP状态码 | 错误码 | 描述 | 排查建议 |
---|---|---|---|
400 | 1470400 | The request failed due to incorrect request parameters. | 一般可能是请求参数存在问题,导致请求失败,建议根据返回的具体错误进行排查 |
403 | 1470403 | The identity token is incorrect. It should be either user_access_token or tenant_access_token. | 发起请求方的身份token不正确,需要为UserAccessToken或TenantAccessToken其中一种 |
400 | 1470410 | failed to parse rich_summary | 富文本标题解析错误,建议检查一下rich_summary是否存在格式错误,语法格式参见Markdown模块 |
400 | 1470411 | failed to parse rich_description | 富文本描述解析错误,建议检查一下rich_description是否存在格式错误,语法格式参见Markdown模块 |
400 | 1470412 | invalid follower id | 关注者id无效,建议确认一下是否向follower_ids字段传入了非法的关注者id,如空值“” |
400 | 1470413 | invalid collaborator id | 协作者id无效,建议确认一下是否向collaborator_ids字段传入了非法的协作者id,如空值“” |
400 | 1470414 | invalid time zone | 填入的时区信息不合规,建议检查timezone字段是否格式正确,传入值需要符合IANA Time Zone Database标准,规范见Time Zone Database |
400 | 1470415 | invalid platform_i18n_name | 任务导入来源的名称不合规,建议检查platform_i18n_name字段是否格式正确,可能传入了不支持的地区名 |
400 | 1470423 | task id is missing | 传入的任务id丢失 |
400 | 1470424 | update_fields include unknown field | update_field中包含了未知的字段 |
400 | 1470425 | update_fields include forbidden field | update_field中包含了禁止更新的字段 |
400 | 1470426 | expected one or more update field | update_field为空,应该填充需要更新的字段 |
400 | 1470450 | request too fast | 当前同时发起的请求过多,峰值较高导致了限流,请稍后重新尝试 |
400 | 1470602 | Invalid task id. | 请检查任务的 id 是否合法 |
500 | 1470603 | update task failed | 一般是业务逻辑校验未通过 |
400 | 1470740 | Text content fails to pass the audit. | 一般是任务的标题或描述或富文本内容存在非法内容,没有通过安全内容检查 |
500 | 1470741 | failed to audit task | 任务内容审核失败,建议结合失败原因排查。如果无法解决,请提供 request id 并联系飞书技术人员协助排查 |
400 | 1470404 | be refused to create or update task, perhaps you have no permission | 一般是因为操作者没有操作权限,导致更新任务或其他更新任务的操作失败。如,任务的关注者没有权限修改任务。 |
400 | 1470434 | invalid repeat rule, please check the format | 重复规则无法解析,可能是传入了不正确的格式,请检查是否符合语法规范 |
400 | 1470435 | decode extra by base64 failed | extra字段无法按base64格式解析,请检查传入的内容是否由base64编码后传入 |
400 | 1470436 | failed to parse url of origin, should start with http, https or applink | 解析Origin中的URL失败,请检查是否以http、https或applink开头 |
400 | 1470437 | summary or description length exceed limit, the maximum length of summary is 256, the maximum length of description is 65536 | 任务标题或者描述的文本长度超出限制,标题文本最大长度为256个字符,描述文本最大长度是65536个字符 |
400 | 1470438 | invalid custom, please check the format | Custom字段格式错误,请根据字段说明检查 |
400 | 1470439 | failed to get time by timestamp | 无法解析时间戳,请根据字段说明检查时间戳是否符合规范 |
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request PATCH 'https://open.feishu.cn/open-apis/task/v1/tasks/83912691-2e43-47fc-94a4-d512e03984fa?user_id_type=open_id' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
"task": {
"summary": "每天喝八杯水,保持身心愉悦",
"description": "多吃水果,多运动,健康生活,快乐工作。",
"extra": "dGVzdA==",
"due": {
"time": "1623124318",
"timezone": "Asia/Shanghai",
"is_all_day": false
},
"origin": {
"platform_i18n_name": "{\"zh_cn\": \"IT 工作台\", \"en_us\": \"IT Workspace\"}",
"href": {
"url": "https://support.feishu.com/internal/foo-bar",
"title": "反馈一个问题,需要协助排查"
}
},
"can_edit": true,
"custom": "{\"custom_complete\":{\"android\":{\"href\":\"https://www.feishu.cn/\",\"tip\":{\"zh_cn\":\"你好\",\"en_us\":\"hello\"}},\"ios\":{\"href\":\"https://www.feishu.cn/\",\"tip\":{\"zh_cn\":\"你好\",\"en_us\":\"hello\"}},\"pc\":{\"href\":\"https://www.feishu.cn/\",\"tip\":{\"zh_cn\":\"你好\",\"en_us\":\"hello\"}}}}",
"repeat_rule": "FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR"
},
"update_fields": ["summary"]
}'
响应示例响应示例
{
"code": 0,
"data": {
"task": {
"can_edit": true,
"complete_time": "0",
"create_time": "1630304148",
"creator_id": "ou_05b67908bc5d12a086e909a076f7f1b6",
"description": "多吃水果,多运动,健康生活,快乐工作。",
"due": {
"time": "1623124318",
"timezone": "Asia/Shanghai"
},
"extra": "dGVzdA==",
"id": "68c9b9ff-d5b5-41bf-b407-6d956f23143f",
"origin": {
"href": {
"title": "反馈一个问题,需要协助排查",
"url": "https://support.feishu.com/internal/foo-bar"
},
"platform_i18n_name": "{\"en_us\":\"IT Workspace\",\"zh_cn\":\"IT 工作台\"}"
},
"summary": "每天喝八杯水,保持身心愉悦",
"custom": "{\"custom_complete\":{\"android\":{\"href\":\"https://www.feishu.cn/\",\"tip\":{\"zh_cn\":\"你好\",\"en_us\":\"hello\"}},\"ios\":{\"href\":\"https://www.feishu.cn/\",\"tip\":{\"zh_cn\":\"你好\",\"en_us\":\"hello\"}},\"pc\":{\"href\":\"https://www.feishu.cn/\",\"tip\":{\"zh_cn\":\"你好\",\"en_us\":\"hello\"}}}}",
"update_time": "1630304149",
"source": 6,
"repeat_rule": "FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR"
}
},
"msg": "success"
}
请求参数
Path 参数
task_id
必需
示例值:
83912691-2e43-47fc-94a4-d512e03984fa
Query 参数
user_id_type
必需
示例值:
open_id
Header 参数
Authorization
string
必需
默认值:
Bearer {{access_token}}
Content-Type
string
必需
默认值:
application/json; charset=utf-8
Body 参数application/json
返回响应
修改于 2023-02-02 07:48:02