企业内部开发 服务端API 日程 管理日程 更新日程
更新日程
最后更新:2023/10/24
可联系渠道经理采购或代理智慧硬件接口已支持设备 联系渠道经理
更新日程
最后更新:2023/10/24

该接口用于在日历中更新指定的日程。

*注意,更新操作是覆盖式,而不是增量式 *
1. 如果需要增量式更新成员,可使用后面的“新增日程参与者”与“删除日程参与者”接口
2.不可更新创建者和日程所属日历ID
3.若修改字段跟会议室有关联,已预约会议室的日程无法通过此接口进行更新,应用可先取消会议室的预定,再更新日程 。跟会议室关联的字段有:
- start_time:
- end_time
- is_whole_day
- is_repeat
- repeat_type
- repeat_until
- is_custom_repeat
- repeat_interval
- repeat_day_of_week
- repeat_day_of_month
- timezone

 

请求方式: POST(HTTPS
请求地址: https://qyapi.weixin.qq.com/cgi-bin/oa/schedule/update?access_token=ACCESS_TOKEN

请求包体:

{
	"skip_attendees": 0,
	"op_mode": 1,
	"op_start_time": 1571274600,
	"schedule": {
		"admins":[
				"admin1",
				"admin2"
		],
		"schedule_id": "17c7d2bd9f20d652840f72f59e796AAA",
		"start_time": 1571274600,
		"end_time": 1571320210,
		"is_whole_day":1,
		"attendees": [{
			"userid": "userid2"
		}],
		"summary": "test_summary",
		"description": "test_description",
		"reminders": {
			"is_remind": 1,
			"remind_before_event_secs": 3600,
			"remind_time_diffs":[0,3600],
			"is_repeat": 1,
			"repeat_type": 7,
			"repeat_until": 1606976813,
			"is_custom_repeat": 1,
			"repeat_interval": 1,
			"repeat_day_of_week": [3, 7],
			"repeat_day_of_month": [10, 21],
			"timezone": 8
		},
		"location": "test_place"
	}
}

参数说明:

参数必须类型说明
access_tokenstring调用接口凭证
skip_attendeesuint32是否不更新参与人。0-否;1-是。默认为0
op_modeuint32操作模式。是重复日程时有效。
0-默认全部修改;
1-仅修改此日程;
2-修改将来的所有日程
详见重复日程的不同操作模式
op_start_timeuint32操作起始时间。仅当操作模式是1或2时有效。该时间必须是重复日程的某一次开始时间
例如:假如日程开始时间start_time为1661990950(2022-09-01 08:09:10),且重复类型是每周,那么op_start_time可以是:1661990950(2022-09-01 08:09:10)、1662595750(2022-09-08 08:09:10)、1663200550(2022-09-15 08:09:10)......
scheduleobj日程信息
schedule.schedule_idstring日程ID。创建日程时返回的ID
schedule.adminsstring[]日程的管理员userid列表,管理员必须在共享成员的列表中。最多指定3人
schedule.attendeesobj[]日程参与者列表。最多支持1000人
schedule.attendees.useridstring日程参与者ID
不多于64字节
schedule.summarystring日程标题。0 ~ 128 字符。不填会默认显示为“新建事件”
schedule.descriptionstring日程描述
不多于1000个字符
schedule.remindersobj提醒相关信息
schedule.reminders.is_remindint32是否需要提醒。0-否;1-是
schedule.reminders.is_repeatint32是否重复日程。0-否;1-是
schedule.reminders.remind_before_event_secsuint32日程开始(start_time)前多少秒提醒,当is_remind为1时有效。
例如: 300表示日程开始前5分钟提醒。目前仅支持以下数值:
0 - 事件开始时
300 - 事件开始前5分钟
900 - 事件开始前15分钟
3600 - 事件开始前1小时
86400 - 事件开始前1天
schedule.reminders.remind_time_diffsint32[]提醒时间与日程开始时间(start_time)的差值,当is_remind为1时有效,可以指定多个提醒时间,目前仅支持以下数值:
0 - 事件开始时
-300 - 事件开始前5分钟
-900 - 事件开始前15分钟
-3600 - 事件开始前1小时
-86400 - 事件开始前1天
当is_whole_day=1时,还支持:
32400 - 事件开始当天(09:00)
-172800 - 事件开始前两天
-604800 - 事件开始前1周
该字段与remind_before_event_secs仅一个字段会生效,当该字段有传值且列表不为空时,优先以该字段为准
schedule.reminders.repeat_typeuint32重复类型,当is_repeat为1时有效。目前支持如下类型:
0 - 每日
1 - 每周
2 - 每月
5 - 每年
7 - 工作日
schedule.reminders.repeat_untiluint32重复结束时刻,Unix时间戳,当is_repeat为1时有效。不填或填0表示一直重复
schedule.reminders.is_custom_repeatuint32是否自定义重复。0-否;1-是。当is_repeat为1时有效。
schedule.reminders.repeat_intervaluint32重复间隔
仅当指定为自定义重复时有效
该字段随repeat_type不同而含义不同
例如:
repeat_interval指定为2,repeat_type指定为每周重复,那么每2周重复一次;
repeat_interval指定为2,repeat_type指定为每月重复,那么每2月重复一次
schedule.reminders.repeat_day_of_weekuint32[]每周周几重复
仅当指定为自定义重复且重复类型为每周时有效
取值范围:1 ~ 7,分别表示周一至周日
schedule.reminders.repeat_day_of_monthuint32[]每月哪几天重复
仅当指定为自定义重复且重复类型为每月时有效
取值范围:1 ~ 31,分别表示1~31号
schedule.reminders.timezoneuint32时区。UTC偏移量表示(即偏离零时区的小时数),东区为正数,西区为负数。
例如:+8 表示北京时间东八区
默认为北京时间东八区
取值范围:-12 ~ +12
schedule.locationstring日程地址
不多于128个字符
schedule.start_timeuint32日程开始时间,Unix时间戳
注意,如果op_mode是1或2,start_time和end_time,必须是op_start_time当天或之后的时间
schedule.end_timeuint32日程结束时间,Unix时间戳
schedule.is_whole_dayuint32是否更新成全天日程,0-否;1-是

 

关于自定义重复的说明:
is_custom_repeat 如果为0,那么系统会根据 start_time 和 repeat_type 来自动计算下一次重复的时间,例如:

start_time 为本周周三8点整,repeat_type 为每周重复,那么每周三8点整重复;
start_time 为本月3号10点整,repeat_type 为每月重复,那么每月3号10点整重复;

如果 is_custom_repeat 指定为1,那么可以配合 repeat_day_of_week 或 repeat_day_of_month 特别指定周几或几号重复,且可以使用 repeat_interval 指定重复间隔


 

返回结果:

{
	"errcode": 0,
	"errmsg" : "ok",
	"schedule_id":"17c7d2bd9f20d652840f72f59e796AAA"
}

参数说明:

参数类型说明
errcodeint32返回码
errmsgstring错误码描述
schedule_idstring修改重复日程新产生的日程ID。对于重复日程,如果不是修改全部周期,会修剪原重复日程,产生新的重复日程,此时会返回新日程的ID
上一篇
创建日程
下一篇
更新重复日程