使用 google 日历 API 发送邀请

Send invites with google calendar API

我有一个 Java Spring API,我想在其中集成 Google 日历。

任务:

我在这里试过这个例子: https://developers.google.com/google-apps/calendar/quickstart/java

但我认为这不合适,因为我作为用户进行了身份验证 - 或者我需要这个来通过电子邮件向他们发送邀请吗?

谁能给我指出正确的方向?

尝试将通知设置为 true。

sendNotifications

  • Whether to send notifications about the creation of the new event. Optional. The default is False.

在试试这个 API(事件:插入):

我对 java 不是很熟悉,但尝试按照相关 SO post 中的建议使用此代码。

Event createdEvent = calendario.events().insert("some-mail-from-google0@group.calendar.google.com", event).setSendNotifications(true).execute();

希望这对您有所帮助。

您需要在 execute() 之前添加 .setSendNotifications(true)。 google 日历示例

中没有此行

sendNotifications 已贬值。

您应该在查询字符串中使用“sendUpdates”,例如javascript:

    let request = gapi.client.calendar.events.insert({
        "calendarId": workCalendar,
        "resource": newEvent,
        "sendUpdates": "externalOnly"
    });