Google日历:修改事件访客状态 [英] Google Calender: Modify Event Guest Status

查看:142
本文介绍了Google日历:修改事件访客状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Google日历中为我的应用程序脚本构建API。

In google calendar build in API for my app script.

https:// developers.google.com/apps-script/reference/calendar/

我想要做的是获得事件的来宾并改变他状态从是改为不。

What I want to do is get the get the guest of an event and change his status from "yes" to "no".

var calendar = CalendarApp.getCalendarById('id');
var events = calendar.getEventsForDay(today);
Logger.log('Guest Status: ' + events[0].getGuestList()[0].getGuestStatus());

我上面的代码几乎可以获取客户并获得他的状态,我正在查看API页面活动嘉宾:

My above code pretty much get the guest and get his status, I am looking at the API page for Event Guest:

https://developers.google.com/apps-script/reference/calendar/event-guest

它只为您提供getter方法客人,是否有任何设置方法的事件客人?我正在寻找一种为客人设置状态的方法。我如何做到这一点?

It only gives you getter methods for the guest, are there any setter methods for event guest? I am looking for a method to set status for guest. How do I do that?

推荐答案

使用CalendarApp仅限于 setMyStatus 方法,您只能设置有效用户的事件状态。

Using CalendarApp you are limited to the setMyStatus method and you can only set the event status of the effective user.

如果所有用户都在您的域名上,那么您可以设想运行服务帐户并使用域名委托,调用 Calendar API 通过 UrlFetch 并假冒每个用户,将他们的responseStatus设置为拒绝该事件。

If all users are on your domain then you could conceivably run a service account with domain delegation, calling the Calendar API via UrlFetch and impersonating each user, setting their "responseStatus" to "declined" for the event.

这篇关于Google日历:修改事件访客状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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