创建任务
POST
/open-apis/task/v1/tasks
自建应用商店应用
错误码
HTTP状态码 | 错误码 | 描述 | 排查建议 |
---|---|---|---|
400 | 1470400 | The request failed due to incorrect request parameters. | 一般可能是请求参数存在问题,导致请求失败,建议根据返回的具体错误进行排查 |
401 | 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 | 1470414 | invalid time zone | 填入的时区信息不合规,建议检查timezone字段是否格式正确,传入值需要符合IANA Time Zone Database标准,规范见Time Zone Database |
400 | 1470415 | invalid platform_i18n_name | 任务导入来源的名称不合规,建议检查platform_i18n_name字段是否格式正确,可能传入了不支持的地区名 |
400 | 1470416 | Both summary and rich_summary are empty. | 标题和富文本标题都没有设置内容,创建任务时要求必须填入其中一个字段 |
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 | 无法解析时间戳,请根据字段说明检查时间戳是否符合规范 |
429 | 1470450 | request too fast | 当前同时发起的请求过多,峰值较高导致了限流,请稍后重新尝试 |
500 | 1470600 | Failed to create task. | 任务创建失败,若重试无法解决,请联系飞书技术人员协助排查 |
400 | 1470740 | Text content fails to pass the audit. | 一般是任务的标题或描述或富文本内容存在非法内容,没有通过安全内容检查 |
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://open.feishu.cn/open-apis/task/v1/tasks?user_id_type=open_id' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
"summary": "每天喝八杯水,保持身心愉悦",
"description": "多吃水果,多运动,健康生活,快乐工作。",
"rich_summary": "富文本标题[飞书开放平台](https://open.feishu.cn)",
"rich_description": "富文本备注[飞书开放平台](https://open.feishu.cn)",
"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\"}}}}",
"follower_ids": ["ou_13585843f02bc94923ed17a007cbc9b1", "ou_219a0611de2a639aa939ee97013f37a5"],
"collaborator_ids": ["ou_13585843f02bc94923ed17a007cbc9b1", "ou_219a0611de2a639aa939ee97013f37a5"],
"repeat_rule": "FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR"
}'
响应示例响应示例
{
"code": 0,
"data": {
"task": {
"can_edit": true,
"complete_time": "0",
"create_time": "1630304148",
"creator_id": "ou_05b67908bc5d12a086e909a076f7f1b6",
"description": "多吃水果,多运动,健康生活,快乐工作。",
"rich_description": "富文本备注飞书开放平台\n",
"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": "每天喝八杯水,保持身心愉悦",
"rich_summary": "富文本标题飞书开放平台\n",
"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,
"collaborators": [
{
"id": "ou_13585843f02bc94923ed17a007cbc9b1"
},
{
"id": "ou_219a0611de2a639aa939ee97013f37a5"
}
],
"followers": [
{
"id": "ou_13585843f02bc94923ed17a007cbc9b1"
},
{
"id": "ou_219a0611de2a639aa939ee97013f37a5"
}
],
"repeat_rule": "FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR"
}
},
"msg": "success"
}
请求参数
Query 参数
user_id_type
必需
示例值:
open_id
Header 参数
Authorization
string
必需
默认值:
Bearer {{access_token}}
Content-Type
string
必需
默认值:
application/json; charset=utf-8
Body 参数application/json