使用 google 日历 API 发送邀请
Send invites with google calendar API
我有一个 Java Spring API,我想在其中集成 Google 日历。
任务:
- 基本上是为两个与会者(用户)创建一个活动,并向他们发送一个带有选项 accept/decline 的邀请(标准 GCalendar 邀请)
我在这里试过这个例子:
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"
});
我有一个 Java Spring API,我想在其中集成 Google 日历。
任务:
- 基本上是为两个与会者(用户)创建一个活动,并向他们发送一个带有选项 accept/decline 的邀请(标准 GCalendar 邀请)
我在这里试过这个例子: 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"
});