无法在java中添加到Google日历事件的meet链接



我正在研究一个为我安排事件的春季启动api,但它的工作很好,但随着事件的发生,我想添加一个会面链接,我也无法做到这一点。我正在使用云控制台的服务帐户,并与此服务帐户共享我的个人帐户。我如何实现谷歌会面?

下面是我的代码:

Event event = new Event()
.setSummary("Google I/O 2015")
.setLocation("800 Howard St., San Francisco, CA 94103")
.setDescription("A chance to hear more about Google's developer products.");
ConferenceSolutionKey conferenceSKey = new ConferenceSolutionKey();
conferenceSKey.setType("hangoutsMeet");
CreateConferenceRequest createConferenceReq = new CreateConferenceRequest();
createConferenceReq.setRequestId("adojajaod"); // ID generated by you
createConferenceReq.setConferenceSolutionKey(conferenceSKey);
ConferenceData conferenceData = new ConferenceData();
conferenceData.setCreateRequest(createConferenceReq);
System.out.println(conferenceData);
event.setConferenceData(conferenceData);

DateTime startDateTime = new DateTime("2021-08-14T09:00:00-07:00");
EventDateTime start = new EventDateTime()
.setDateTime(startDateTime)
.setTimeZone("America/Los_Angeles");
event.setStart(start);
DateTime endDateTime = new DateTime("2021-08-15T17:00:00-07:00");
EventDateTime end = new EventDateTime()
.setDateTime(endDateTime)
.setTimeZone("America/Los_Angeles");
event.setEnd(end);
String[] recurrence = new String[]{"RRULE:FREQ=DAILY;COUNT=2"};
event.setRecurrence(Arrays.asList(recurrence));
EventReminder[] reminderOverrides = new EventReminder[]{
new EventReminder().setMethod("email").setMinutes(24 * 60),
new EventReminder().setMethod("popup").setMinutes(10),
};
Event.Reminders reminders = new Event.Reminders()
.setUseDefault(false)
.setOverrides(Arrays.asList(reminderOverrides));
event.setReminders(reminders);

event = client.events().insert("himanshuranjan30@gmail.com", event).setConferenceDataVersion(1).execute();
System.out.printf("Event created: %sn", event.getHtmlLink());

这里我试图使用会议设置一个会议链接,但它不工作,并给出一个错误,如:

{
"code" : 400,
"errors" : [ {
"domain" : "global",
"message" : "Invalid conference type value.",
"reason" : "invalid"
} ],
"message" : "Invalid conference type value."
}

任何帮助都将不胜感激。

conferenceSKey.setType("hangoutsMeet");

似乎您尝试插入事件的日历不接受"hangoutmet";电话会议类型。

要验证,请使用Calendar API的get来查看目标Calendar元数据。https://developers.google.com/calendar/api/v3/reference/calendars你可以在

下面看到允许的类型
"conferenceProperties": {
"allowedConferenceSolutionTypes": [
string
]
}

相关内容

  • 没有找到相关文章

最新更新