您能给我一个关于如何通过 google calendar api 共享单个事件的提示吗?
That is I'd like to invite other users to see the event programmatically without sharing the whole calendar. To mimic the "Add guests" UI action
![The google calendar Add guests](https://i.stack.imgur.com/qrsKN.png)
正如 Claudio 提到的,您需要为此使用 Google Calendar Advanced API。
你会想要使用一个patch
因为您不想替换日历邀请上的所有其他数据。然而,即使在以下情况下patch
,由于与会者居住在一个数组中,如果您尝试传递如下所示的补丁:
{
attendees: [ { email: "[email protected]"} ]
}
...它将替换所有旧的受邀者(即,它将删除您致电之前邀请中的任何人patch
)。要解决此问题,您必须首先获取当前的受邀者,将新人添加到数组中,然后发送patch
.
您可以在以下位置查看详细示例这个答案其中还解释了如何使用 Google Apps 脚本来确保在将用户添加到日历活动时向用户发送电子邮件(请参阅addGuestAndSendEmail()
该帖子中的方法)。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)