GAS - Access Other User's Calendar ID

一笑奈何 提交于 2021-01-01 13:46:07

问题


I have a Google App for Business.

Is it possible to access other user's calendar to input & retrieve event? I only know how to do it for my own calendar, but not others. I have super administrator access.


回答1:


Yes, you can get any calendar by it's ID, and then just get the events. As per your comment I don't believe that it will allow you to get any calendar in the domain, you appear to need to be subscribed. Whether this is expected or not I'm unsure.

Enter the Advanced Calendar Service, which uses the Calendar API to manage your domains calendars (and I suspect is probably the correct way to go about managing your domains calendars). After you turn the calendar service on, you can do what your looking for simply like so:

function calendar(){
  var cal = Calendar.Calendars.get('calendar@domain');
  Logger.log(cal.summary);
};

Which will return the 'name' of the calendar. (Note: For primary calendars, the 'name' of the calendar is almost always the same as the calendar ID).



来源:https://stackoverflow.com/questions/27499091/gas-access-other-users-calendar-id

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!