# 获取工作日历日期详情

获取工作日历每一天的日期详情，如日期、日期类型等

## 请求

基本 | &nbsp;
---|---
HTTP URL | https://open.feishu.cn/open-apis/corehr/v1/leaves/work_calendar_date
HTTP Method | POST
接口频率限制 | [100 次/分钟](https://open.feishu.cn/document/ukTMukTMukTM/uUzN04SN3QjL1cDN)
支持的应用类型 | Custom App、Store App
权限要求<br>**调用该 API 所需的权限。开启其中任意一项权限即可调用**<br>开启任一权限即可 | 获取核心人事信息(corehr:corehr:readonly)<br>查询工作日历(corehr:work_calendar:read)<br>更新核心人事信息(corehr:corehr)

### 请求头

名称 | 类型 | 必填 | 描述
---|---|---|---
Authorization | string | 是 | `tenant_access_token`<br>或<br>`user_access_token`<br>**值格式**："Bearer `access_token`"<br>**示例值**："Bearer u-7f1bcd13fc57d46bac21793a18e560"<br>[了解更多：如何选择与获取 access token](https://open.feishu.cn/document/uAjLw4CM/ugTN1YjL4UTN24CO1UjN/trouble-shooting/how-to-choose-which-type-of-token-to-use)
Content-Type | string | 是 | **固定值**："application/json; charset=utf-8"

### 请求体

名称 | 类型 | 必填 | 描述
---|---|---|---
wk_calendar_ids | string\[\] | 是 | 工作日历ID列表，最多100；可以通过[获取工作日历<br>](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/leave/work_calendar) 获取工作日历ID<br>**示例值**：["7390282135276635692"]<br>**数据校验规则**：<br>- 长度范围：`1` ～ `100`
dates | string\[\] | 否 | 日期，格式："2006-01-02"，最多50个；<br>**注意**：<br>- 如果不传 ids 参数，则必须传 dates 参数或 [begin_date，end_date]参数<br>- 如果传 ids 参数，则仅生效 ids 参数，无需传 dates 参数或 [begin_date，end_date]参数<br>**示例值**：["2006-01-02"]<br>**数据校验规则**：<br>- 长度范围：`1` ～ `50`
begin_date | string | 否 | 日期范围-开始日期，格式："2006-01-02"；需要和end_date一起使用；<br>**注意**：<br>- 如果不传 ids 参数，则必须传 dates 参数或 [begin_date，end_date]参数<br>- 如果传 ids 参数，则仅生效 ids 参数，无需传 dates 参数或 [begin_date，end_date]参数<br>**示例值**："2006-01-02"
end_date | string | 否 | 日期范围-结束日期(含)，格式："2006-01-02"；需要和begin_date一起使用<br>**示例值**："2006-01-02"
offset | int | 否 | 分页<br>**示例值**：0
limit | int | 否 | 分页大小，无默认值需手动设置<br>**示例值**：10
ids | string\[\] | 否 | 日期id，可使用响应体中的data.calendar_dates.id<br>**注意**：<br>- 如果不传 ids 参数，则必须传 dates 参数或 [begin_date，end_date]参数<br>- 如果传 ids 参数，则仅生效 ids 参数，无需传 dates 参数或 [begin_date，end_date]参数<br>**示例值**：["7390282135276635692"]<br>**数据校验规则**：<br>- 长度范围：`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 | 日期类型<br>**可选值有**：<br>- day_off：休息日<br>- public_holiday：公共假日<br>- 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 | 内部错误，请联系开发人员；开放平台技术支持入口 [技术支持](https://applink.feishu.cn/TLJpeNdW)

