写入审批结果
POST
/open-apis/attendance/v1/user_approvals
目前支持写入加班、请假、出差和外出这四种审批结果,写入只会追加(insert),不会覆盖(update)(开放接口导入的加班假期记录,在管理后台的假期加班里查不到,只能通过获取审批通过数据来查询)
错误码
HTTP状态码 | 错误码 | 描述 | 排查建议 |
---|---|---|---|
400 | 1220001 | 参数错误 | 请检查参数是否符合要求 |
400 | 1220002 | 租户不存在 | 请检查 tenant_access_token 是否正确 |
400 | 1220004 | 用户不存在或没有权限 | 请检查用户 ID 是否正确 |
400 | 1220005 | 没有权限 | 请前往考勤管理后台检查数据权限范围 |
500 | 1225000 | 系统错误 | 详见错误信息 |
400 | 1225001 | 写入部分成功 | 详见错误信息 |
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://open.feishu.cn/open-apis/attendance/v1/user_approvals?employee_type=employee_id' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
"user_approval": {
"user_id": "abd754f7",
"date": "20210104",
"outs": [
{
"uniq_id": "9496E43696967658A512969523E89870",
"unit": 1,
"interval": 28800,
"start_time": "2021-01-04 09:00:00",
"end_time": "2021-01-04 19:00:00",
"i18n_names": {
"ch": "中文描述",
"en": "English description",
"ja": "日本語の説明"
},
"default_locale": "ch",
"reason": "外出办事"
}
],
"leaves": [
{
"uniq_id": "6852582717813440527",
"unit": 1,
"interval": 28800,
"start_time": "2021-01-04 09:00:00",
"end_time": "2021-01-04 19:00:00",
"i18n_names": {
"ch": "中文描述",
"en": "English description",
"ja": "日本語の説明"
},
"default_locale": "ch",
"reason": "家里有事"
}
],
"overtime_works": [
{
"duration": 1.5,
"unit": 1,
"category": 2,
"type": 1,
"start_time": "2021-01-09 09:00:00",
"end_time": "2021-01-10 13:00:00"
}
],
"trips": [
{
"start_time": "2021-01-04 09:00:00",
"end_time": "2021-01-04 19:00:00",
"reason": "培训",
"approve_pass_time": "2021-01-04 12:00:00",
"approve_apply_time": "2021-01-04 11:00:00"
}
]
}
}'
响应示例响应示例
{
"code": 0,
"msg": "success",
"data": {
"user_approval": {
"user_id": "abd754f7",
"date": "20210104",
"outs": [
{
"approval_id": "6737202939523236113",
"uniq_id": "9496E43696967658A512969523E89870",
"unit": 1,
"interval": 28800,
"start_time": "2021-01-04 09:00:00",
"end_time": "2021-01-04 19:00:00",
"i18n_names": {
"ch": "中文描述",
"en": "English description",
"ja": "日本語の説明"
},
"default_locale": "ch",
"reason": "外出办事",
"approve_pass_time": "2021-01-04 12:00:00",
"approve_apply_time": "2021-01-04 11:00:00"
}
],
"leaves": [
{
"approval_id": "6737202939523236113",
"uniq_id": "6852582717813440527",
"unit": 1,
"interval": 28800,
"start_time": "2021-01-04 09:00:00",
"end_time": "2021-01-04 19:00:00",
"i18n_names": {
"ch": "中文描述",
"en": "English description",
"ja": "日本語の説明"
},
"default_locale": "ch",
"reason": "家里有事",
"approve_pass_time": "2021-01-04 12:00:00",
"approve_apply_time": "2021-01-04 11:00:00"
}
],
"overtime_works": [
{
"approval_id": "6737202939523236113",
"duration": 1.5,
"unit": 1,
"category": 2,
"type": 1,
"start_time": "2021-01-09 09:00:00",
"end_time": "2021-01-10 13:00:00"
}
],
"trips": [
{
"approval_id": "6737202939523236113",
"start_time": "2021-01-04 09:00:00",
"end_time": "2021-01-04 19:00:00",
"reason": "培训",
"approve_pass_time": "2021-01-04 12:00:00",
"approve_apply_time": "2021-01-04 11:00:00"
}
]
}
}
}
请求参数
Query 参数
employee_type
必需
示例值:
employee_id
Header 参数
Authorization
string
必需
默认值:
Bearer {{access_token}}
Content-Type
string
必需
默认值:
application/json; charset=utf-8
Body 参数application/json
返回响应
修改于 2023-01-28 08:50:20