目录
本文档描述企业文件内容存档中的默认日历本 ID、日程列表和增量日程列表接口。
status 字段。调用应用需要满足以下要求:
| 应用类型 | 权限要求 |
|---|---|
| 自建应用 | 已配置到“文件内容存档 - 可调用接口的应用”中,并开通日程存档权限 |
| 代开发应用 | 暂不支持 |
| 第三方应用 | 暂不支持 |
请求中的 cal_id 解析出的成员(即默认日历本所属成员)必须同时属于以下三个范围:
企业文件内容存档实际生效的总分配范围
∩ 当前应用的可见成员范围
∩ 当前应用配置的文件内容存档范围
该接口用于获取指定存档成员系统原生主日历的 cal_id。返回的 cal_id 作为「获取存档成员主日历下的日程列表」和「获取存档成员主日历下的增量日程列表」接口的入参。
请求方式: POST(HTTPS)
请求地址:
https://qyapi.weixin.qq.com/cgi-bin/security/calendar/get_default_calendar?access_token=ACCESS_TOKEN
{
"userid": "zhangsan",
"is_resigned": 0
}
| 参数 | 是否必须 | 类型 | 说明 |
|---|---|---|---|
access_token | 是 | String | 调用接口凭证,通过请求 URL 传入 |
userid | 是 | String | 需要查询的存档成员 userid |
is_resigned | 否 | Integer | 是否查询已离职成员。0:否(默认);1:是 |
{
"errcode": 0,
"errmsg": "ok",
"cal_id": "wcjgewCwAAqeJcPI1d8Pwbjt7nttzAAA"
}
| 参数 | 类型 | 说明 |
|---|---|---|
errcode | Integer | 错误码 |
errmsg | String | 错误码说明 |
cal_id | String | 该成员系统原生主日历的 ID |
该接口用于分页获取指定存档成员系统原生主日历中的日程 ID。
请求方式: POST(HTTPS)
请求地址:
https://qyapi.weixin.qq.com/cgi-bin/security/calendar/get_schedule_list?access_token=ACCESS_TOKEN
{
"cal_id": "wcjgewCwAAqeJcPI1d8Pwbjt7nttzAAA",
"cursor": "JMgigeong",
"limit": 200
}
| 参数 | 是否必须 | 类型 | 说明 |
|---|---|---|---|
access_token | 是 | String | 调用接口凭证,通过请求 URL 传入 |
cal_id | 是 | String | 需要查询的存档成员系统原生主日历 cal_id,通过「获取默认日历本 ID」接口获取,长度 1~64 字节 |
cursor | 否 | String | 上一次调用返回的 next_cursor。第一次拉取不填,最大长度为 128 字节 |
limit | 否 | Integer | 本次最多返回的日程 ID 数量,范围为 1~1000,默认 200 |
{
"errcode": 0,
"errmsg": "ok",
"schedule_id_list": [
"17c7d2bd9f20d652840f72f59e796AAA",
"27d8e3ce0f31e763951f83f60f807BBB"
],
"next_cursor": "xjigeojgeigwj",
"has_more": 1
}
| 参数 | 类型 | 说明 |
|---|---|---|
errcode | Integer | 错误码 |
errmsg | String | 错误码说明 |
schedule_id_list | String 数组 | 指定成员系统原生主日历中的日程 ID 列表 |
next_cursor | String | 下一页游标。仅当 has_more=1 时返回 |
has_more | Integer | 是否还有更多数据。1:是;0:否 |
cursor;has_more=1 时,将 next_cursor 原样传入下一次请求;has_more=0 时,本轮分页结束;cal_id 绑定,不能跨企业、跨应用或跨成员复用;该接口用于获取指定存档成员主日历在某个 cursor 之后发生变化的日程详情,可用于增量同步日程信息。
例如,首次同步获得日程 A、B、C 以及 next_cursor。之后用户修改日程 A,并新增日程 D,再使用该 next_cursor 调用接口,将返回日程 A 和日程 D 的最新详情。
请求方式: POST(HTTPS)
请求地址:
https://qyapi.weixin.qq.com/cgi-bin/security/calendar/get_schedule_list_by_sequence?access_token=ACCESS_TOKEN
{
"cal_id": "wcjgewCwAAqeJcPI1d8Pwbjt7nttzAAA",
"cursor": "JMgigeong",
"limit": 500
}
| 参数 | 是否必须 | 类型 | 说明 |
|---|---|---|---|
access_token | 是 | String | 调用接口凭证,通过请求 URL 传入 |
cal_id | 是 | String | 需要增量同步的存档成员系统原生主日历 cal_id,通过「获取默认日历本 ID」接口获取,长度 1~64 字节 |
cursor | 否 | String | 增量拉取游标。首次拉取不填;后续使用上一次返回的 next_cursor,最大长度为 128 字节 |
limit | 否 | Integer | 本次最多扫描的增量索引数量,范围为 1~1000,默认 500 |
{
"errcode": 0,
"errmsg": "ok",
"next_cursor": "xjigeojgeigwj",
"schedule_list": [
{
"schedule_id": "17c7d2bd9f20d652840f72f59e796AAA",
"organizer": "zhangsan",
"attendees": [
{
"userid": "lisi",
"response_status": 0
}
],
"summary": "项目周会",
"description": "同步项目进度",
"reminders": {
"is_remind": 1,
"is_repeat": 1,
"remind_before_event_secs": 900,
"repeat_type": 1,
"repeat_until": 0,
"is_custom_repeat": 1,
"repeat_interval": 1,
"repeat_day_of_week": [1],
"timezone": 8
},
"location": "第一会议室",
"start_time": 1770000000,
"end_time": 1770003600,
"status": 0,
"cal_id": "wcjgewCwAAqeJcPI1d8Pwbjt7nttzAAA",
"is_whole_day": 0
}
]
}
| 参数 | 类型 | 说明 |
|---|---|---|
errcode | Integer | 错误码 |
errmsg | String | 错误码说明 |
next_cursor | String | 下一次增量查询使用的游标 |
schedule_list | Object 数组 | 本批发生变化且当前仍可读取的日程详情,结构详见 ScheduleDetail |
cursor,从该成员主日历现有增量索引起点开始读取;next_cursor;next_cursor 原样传入;cal_id 绑定,不能跨企业、跨应用或跨成员复用;next_cursor 按本次已扫描索引的最大 sequence 推进;schedule_list,但对应索引仍会推进 cursor;schedule_list 为空表示本批没有可返回的日程详情,调用方仍应保存 next_cursor;status=1。| 参数 | 类型 | 说明 |
|---|---|---|
schedule_id | String | 日程 ID |
organizer | String | 日程创建者的 userid |
attendees | Object 数组 | 当前有效参与者列表,最多支持 1000 人 |
attendees.userid | String | 参与者 userid;外部联系人按开放字段转换规则返回 |
attendees.response_status | Integer | 接受状态:0 未处理;1 待定;2 全部接受;3 仅接受一次;4 拒绝 |
summary | String | 日程标题 |
description | String | 日程描述 |
location | String | 日程地点,不多于 128 个字符 |
start_time | Integer | 日程开始时间,Unix 时间戳 |
end_time | Integer | 日程结束时间,Unix 时间戳 |
status | Integer | 日程状态:0 正常;1 已取消 |
cal_id | String | 日程所属日历 ID。仅系统原生主日历或 API 日历返回 |
is_whole_day | Integer | 是否为全天日程:0 否;1 是 |
admins | String 数组 | 日程管理员 userid 列表 |
allow_active_join | Boolean | 是否允许非参与人主动加入日程 |
only_organizer_create_chat | Integer | 是否仅允许组织者发起群聊:0 否;1 是 |
| 参数 | 类型 | 说明 |
|---|---|---|
reminders.is_remind | Integer | 是否提醒:0 否;1 是 |
reminders.is_repeat | Integer | 是否重复日程:0 否;1 是 |
reminders.remind_before_event_secs | Integer | 日程开始前多少秒提醒 |
reminders.remind_time_diffs | Integer 数组 | 提醒时间与日程开始时间的差值,可能为负数 |
reminders.repeat_type | Integer | 重复类型:0 每日;1 每周;2 每月;5 每年;7 工作日 |
reminders.repeat_until | Integer | 重复结束时间,Unix 时间戳;0 表示一直重复 |
reminders.is_custom_repeat | Integer | 是否自定义重复:0 否;1 是 |
reminders.repeat_interval | Integer | 自定义重复间隔 |
reminders.repeat_day_of_week | Integer 数组 | 每周重复日期,1~7 表示周一至周日 |
reminders.repeat_day_of_month | Integer 数组 | 每月重复日期,取值范围 1~31 |
reminders.timezone | Integer | UTC 时区偏移小时数,范围 -12~+12 |
reminders.exclude_time_list | Object 数组 | 重复日程中被删除或修改的例外时间列表 |
reminders.exclude_time_list.start_time | Integer | 例外日程原开始时间,Unix 时间戳 |
| 参数 | 类型 | 说明 |
|---|---|---|
meetingid | String | 日程关联会议的开放会议 ID |
meeting_code | String | 腾讯会议会议号,仅符合返回条件时提供 |
meeting_link | String | 腾讯会议入会链接,仅符合返回条件时提供 |
meetingroom_id | Integer | 日程关联会议室的开放配置 ID,仅符合返回条件时提供 |
cal_id 解析出的成员必须属于文件内容存档实际生效成员范围;