GoogleCalendarAPI接受/拒绝事件 [英] GoogleCalendarAPI accept/decline event

查看:113
本文介绍了GoogleCalendarAPI接受/拒绝事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在致力于 GoogleCalendar API ,并使用 node.js 作为构建应用程序的平台。
我能够使用身份验证程序创建事件,并使用身份验证时生成的访问令牌创建日历事件。



我的问题是,假设我们有任何与会者在事件中,我想使用来自与会者方的日历API来接受/拒绝该事件,我们该如何做到这一点?



我试着抓取日历事件并将其与最初创建的事件的 iCalUID 匹配,然后使用与会者日历上的更新事件修改事件。

解决方案

活动创建者或所有者不能修改与会者的回复。只有与会者才能修改其状态。

要更新用户侧的状态,您可以使用Event.update API并为'attendees.responseStatus'提供值。参与者的回复状态有4(4)个可能的值(如下所述)。

'needsAction' - 尚未回复邀请。
'已拒绝' - 已拒绝邀请。
'暂定' - 已暂时接受邀请
'已接受' - 已接受邀请。

除此之外,您可以使用用于表示当前登录用户的日历标识的值为primary的单词
$ b


CalendarId:日历标识。要检索日历ID,请调用calendarList.list方法。如果您想访问当前登录用户的主日历,请使用主关键字。 (string)。

对于id,你需要使用Events.list API返回的id而不是iCalUID 。如此处所述,这两者是不同的。



您需要提供的其他字段是(与会者)的电子邮件,startdate和enddate。

更多信息,您可以查看官方文档,链接如下:
https: //developers.google.com/google-apps/calendar/v3/reference/events


I am working on GoogleCalendar API and using node.js as a platform to build my application. I am able to create events using authentication procedure and creating the calendar event using the access token generated while authenticating.

My question is that suppose if we have any attendee in the event and I want to accept/decline the event using the calendar API from the attendee's side, how can we do that?

I have tried fetching the calendar event of the attendee and matching it with the iCalUID of the event which was originally created and then modifying the event using update event on the attendee's calendar.

解决方案

Event creator or owner cannot modify the response of attendees. Only attendees can modify their status.

To update the status on the side of the user, You may use the Event.update API and provide value for 'attendees.responseStatus'. Attendee's response status has 4 (four) possible value (described below).

'needsAction' - has not responded to the invitation. 'declined' - has declined the invitation. 'tentative' - has tentatively accepted the invitation 'accepted' - has accepted the invitation.

In addition to this, You can use the word "primary" as value for the calendar id to represent the currently logged in user

CalendarId: Calendar identifier. To retrieve calendar IDs call the calendarList.list method. If you want to access the primary calendar of the currently logged in user, use the "primary" keyword. (string).

For the id, you need to use the "id" returned by the Events.list API not the "iCalUID". Those two are different as described here.

Other fields that you need to provide are the email (of the attendee), startdate and enddate.

For more information, you may view the official documentation, link below: https://developers.google.com/google-apps/calendar/v3/reference/events

这篇关于GoogleCalendarAPI接受/拒绝事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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