创建班次
POST
/open-apis/attendance/v1/shifts
自建应用
错误码
HTTP状态码 | 错误码 | 描述 | 排查建议 |
---|---|---|---|
400 | 1220001 | 参数错误 | 请检查参数是否符合要求 |
400 | 1220002 | 租户不存在 | 请检查 tenant_access_token 是否正确 |
400 | 1220005 | 没有权限 | 请前往考勤管理后台检查数据权限范围 |
500 | 1225000 | 系统错误 | 详见错误信息 |
500 | 1226000 | 班次服务系统错误 | 详见错误信息 |
400 | 1226001 | 班次已被使用 | 请修改班次名称 |
400 | 1226002 | 班次名称已被使用 | 请修改班次名称 |
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://open.feishu.cn/open-apis/attendance/v1/shifts' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
"shift_name": "早班",
"punch_times": 1,
"is_flexible": false,
"flexible_minutes": 60,
"flexible_rule": [
{
"flexible_early_minutes": 60,
"flexible_late_minutes": 60
}
],
"no_need_off": true,
"punch_time_rule": [
{
"on_time": "9:00",
"off_time": "18:00, 第二天凌晨2点, 26:00",
"late_minutes_as_late": 30,
"late_minutes_as_lack": 60,
"on_advance_minutes": 60,
"early_minutes_as_early": 30,
"early_minutes_as_lack": 60,
"off_delay_minutes": 60,
"late_minutes_as_serious_late": 40
}
],
"late_off_late_on_rule": [
{
"late_off_minutes": 60,
"late_on_minutes": 30
}
],
"rest_time_rule": [
{
"rest_begin_time": "13:00",
"rest_end_time": "14:00"
}
]
}'
响应示例响应示例
{
"code": 0,
"msg": "success",
"data": {
"shift": {
"shift_id": "6919358778597097404",
"shift_name": "早班",
"punch_times": 1,
"is_flexible": false,
"flexible_minutes": 60,
"flexible_rule": [
{
"flexible_early_minutes": 60,
"flexible_late_minutes": 60
}
],
"no_need_off": true,
"punch_time_rule": [
{
"on_time": "9:00",
"off_time": "18:00, 第二天凌晨2点, 26:00",
"late_minutes_as_late": 30,
"late_minutes_as_lack": 60,
"on_advance_minutes": 60,
"early_minutes_as_early": 30,
"early_minutes_as_lack": 60,
"off_delay_minutes": 60,
"late_minutes_as_serious_late": 40
}
],
"late_off_late_on_rule": [
{
"late_off_minutes": 60,
"late_on_minutes": 30
}
],
"rest_time_rule": [
{
"rest_begin_time": "13:00",
"rest_end_time": "14:00"
}
]
}
}
}
请求参数
Header 参数
Authorization
string
必需
默认值:
Bearer {{access_token}}
Content-Type
string
必需
默认值:
application/json; charset=utf-8
Body 参数application/json
返回响应
修改于 2023-01-28 07:55:01