我们在使用 Google 日历 API 为该活动生成 Google 会议链接时遇到问题

问题描述 投票:0回答:1

我们已经集成了谷歌日历 API,但在为该活动生成谷歌会议链接时遇到了问题。我想这是因为我们无法在 Google Meet 的日历中设置AllowedConferenceSolutionTypes。

我们遇到错误

“message”:“会议类型值无效。”

创建日历或其他内容时似乎存在一些权限问题。

这是我用来创建事件的代码:

String calenderId = "xyz";
Event event = new Event().setSummary("Meeting");
event.setStart(getEventDateTime(meetingTime));
event.setEnd(getEventDateTime(meetingTime.plusHours(1)));

ConferenceData conferenceData = new ConferenceData();
CreateConferenceRequest conferenceRequest = new CreateConferenceRequest();
conferenceRequest.setRequestId(UUID.randomUUID().toString());
conferenceRequest.setConferenceSolutionKey((new ConferenceSolutionKey()
.setType("hangoutsMeet")));
conferenceData.setCreateRequest(conferenceRequest);
event.setConferenceData(conferenceData);
try {
event = calendarService.events().insert(calenderId, event).setConferenceDataVersion(1).execute();
} catch (Exception e) {
e.printStackTrace();
}

return event;

我们希望创建一个带有 Meets 链接的 Google 日历活动。我们收到错误“消息”:“会议类型值无效。”但是,当我们在没有 ConferenceData 的情况下执行此操作时,就会创建一个简单的事件。

c# google-api google-calendar-api google-api-dotnet-client
1个回答
0
投票

尝试在该日历上执行calendar.get,它将告诉您用户为该日历配置的会议类型。

{
 "kind": "calendar#calendar",
 "etag": "\"j3g2ipQvsbvz0_YlxYi3Ml2Fd7A\"",
 "id": "[REDACTED]",
 "summary": "Linda Lawton ",
 "description": "test",
 "timeZone": "Europe/Copenhagen",
 "conferenceProperties": {
  "allowedConferenceSolutionTypes": [
   "hangoutsMeet"
  ]
 }
}
© www.soinside.com 2019 - 2024. All rights reserved.