如何通过REST API创建外出类型的日历事件? [英] How do I create an Out of office type Calendar Event via the REST API?

查看:60
本文介绍了如何通过REST API创建外出类型的日历事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Google日历具有一种称为不在办公室"的新事件类型,该事件类型将自动拒绝它所放置的所有事件以及在该事件的预定时间内进入的其他事件.

Google Calendar has a new event type called "Out of office" that automatically will decline any events it is placed over and others that come in during the scheduled time of the event.

我通过API检查了其中一个事件对象,并简要检查了Google Calendar API文档,以查看是否有一种方法可以通过编程方式创建这些对象.我在一个系统上工作,该系统在人们要离开办公室时将事件安排在人们的日历上,以作为一整天的事件来向其他员工提供可见性.我想将其更改为真实的外出事件类型,如果可以的话可以通过API.

I inspected one of these event objects via the API and briefly checked the Google Calendar API documentation to see if there was a way to create these programmatically. I work on a system that schedules events on people's calendars when they are going to be out of the office as all day events to provide visibility to the rest of the staff. I would like to change these to be true Out of office event types if its possible via the API.

推荐答案

唯一将事件标记为不在办公室的事件是事件资源上的私有扩展属性:

The only thing that seemingly marks an event as out of office is a private extended property on the event resource:

"extendedProperties": {
    "private": {
        "everyoneDeclinedDismissed": "-1"
    }
}

查看 https://developers.google.com/calendar/v3 /reference/events/insert 属性extendedProperties.private是可写的,因此您应该可以在此处进行设置.

Looking at https://developers.google.com/calendar/v3/reference/events/insert the attribute extendedProperties.private is writeable so you should be able to set it there.

这篇关于如何通过REST API创建外出类型的日历事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆