获取工作日历日期详情
获取工作日历每一天的日期详情,如日期、日期类型等
请求
| 项目 | 值 |
|---|---|
| HTTP URL | https://open.feishu.cn/open-apis/corehr/v1/leaves/work_calendar_date |
| HTTP Method | POST |
| 接口频率限制 | 100 次/分钟 |
| 支持的应用类型 | custom,isv |
| 权限要求 调用该 API 所需的权限。开启其中任意一项权限即可调用 开启任一权限即可 | corehr:corehr:readonly 获取核心人事信息 corehr:work_calendar:read 查询工作日历 corehr:corehr 更新核心人事信息 |
请求头
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| Authorization | string | 是 | tenant_access_token 或 user_access_token 值格式:"Bearer access_token" 示例值:"Bearer u-7f1bcd13fc57d46bac21793a18e560" 了解更多:如何选择与获取 access token |
| Content-Type | string | 是 | 固定值:"application/json; charset=utf-8" |
请求体
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
wk_calendar_ids | string\[\] | 是 | 工作日历ID列表,最多100;可以通过获取工作日历 获取工作日历ID 示例值:["7390282135276635692"] 数据校验规则: - 长度范围: 1 ~ 100 |
dates | string\[\] | 否 | 日期,格式:"2006-01-02",最多50个; 注意: - 如果不传 ids 参数,则必须传 dates 参数或 [begin_date,end_date]参数 - 如果传 ids 参数,则仅生效 ids 参数,无需传 dates 参数或 [begin_date,end_date]参数 示例值:["2006-01-02"] 数据校验规则: - 长度范围: 1 ~ 50 |
begin_date | string | 否 | 日期范围-开始日期,格式:"2006-01-02";需要和end_date一起使用; 注意: - 如果不传 ids 参数,则必须传 dates 参数或 [begin_date,end_date]参数 - 如果传 ids 参数,则仅生效 ids 参数,无需传 dates 参数或 [begin_date,end_date]参数 示例值:"2006-01-02" |
end_date | string | 否 | 日期范围-结束日期(含),格式:"2006-01-02";需要和begin_date一起使用 示例值:"2006-01-02" |
offset | int | 否 | 分页 示例值:0 |
limit | int | 否 | 分页大小,无默认值需手动设置 示例值:10 |
ids | string\[\] | 否 | 日期id,可使用响应体中的data.calendar_dates.id 注意: - 如果不传 ids 参数,则必须传 dates 参数或 [begin_date,end_date]参数 - 如果传 ids 参数,则仅生效 ids 参数,无需传 dates 参数或 [begin_date,end_date]参数 示例值:["7390282135276635692"] 数据校验规则: - 长度范围: 0 ~ 1000 |
请求体示例
json
{
"wk_calendar_ids": [
"7390282135276635692"
],
"dates": [
"2006-01-02"
],
"begin_date": "2006-01-02",
"end_date": "2006-01-02",
"offset": 0,
"limit": 10,
"ids": [
"7390282135276635692"
]
}响应
响应体
| 名称 | 类型 | 描述 |
|---|---|---|
code | int | 错误码,非 0 表示失败 |
msg | string | 错误描述 |
data | \- | - |
└ calendar_dates | wk_calendar_date\[\] | 日期列表 |
└ calendar_id | string | 工作日历ID |
└ date | string | 日期,格式:"2006-01-02" |
└ date_type | string | 日期类型 可选值有: - day_off: 休息日 - public_holiday: 公共假日 - workday: 工作日 |
└ id | string | 日期id |
响应体示例
json
{
"code": 0,
"msg": "success",
"data": {
"calendar_dates": [
{
"calendar_id": "7390282135276635692",
"date": "2006-01-02",
"date_type": "day_off",
"id": "7390282135276635692"
}
]
}
}错误码
| HTTP状态码 | 错误码 | 描述 | 排查建议 |
|---|---|---|---|
| 500 | 1160501 | tenant id is invalid | 租户ID为空或者无效 |
| 400 | 1160502 | param is invalid | 参数是否正确 |
| 200 | 1160503 | unknown error | 内部错误,请联系开发人员;开放平台技术支持入口 技术支持 |
