1

I'd like to add a hangout meet in my google calendar when I insert the event

here is what I set

ConferenceData conferenceData = new ConferenceData();
CreateConferenceRequest createRequest = new CreateConferenceRequest();
createRequest.setRequestId("3qpalsoyh6");
conferenceData.setCreateRequest(createRequest);
conferenceData.setConferenceId("3qpalsoyh6");
event.setConferenceData(conferenceData);

I have right summary, time....

How to add a Hangouts meet in side!?

And is it possible to assign the host of the hangouts meet to one of the attendees instead of the account which cinsert the event !?

Can anyone help pls! Thanks

蘇柏綸
  • 39
  • 1
  • 10

1 Answers1

2

You are missing the parameter conferenceSolutionKey

It is necessary to specify the conferenceData.createRequest.conferenceSolutionKey.type to add the Hangouts meeting.

The value for type is eventHangout if you have a consumer account or eventNamedHangout if you are a GSuite User.

ziganotschka
  • 25,866
  • 2
  • 16
  • 33
  • I'm trying in another case, that I use a gmail account to create a calendar with a eventHangout, it doesn't work. No hangouts in the calendar. – 蘇柏綸 Apr 07 '20 at 13:55
  • Did you specify the `conferenceDataVersion` to `1` as specified in the [documentation](https://developers.google.com/calendar/v3/reference/events/insert)? https://developers.google.com/resources/api-libraries/documentation/calendar/v3/java/latest/com/google/api/services/calendar/Calendar.Events.Insert.html#setConferenceDataVersion-java.lang.Integer- – ziganotschka Apr 07 '20 at 14:13
  • can you tell me where i should add that, I can't found the function setConferenceDataVersion in java... – 蘇柏綸 Apr 07 '20 at 15:00
  • The java implementation can be found in the second link of my last comment. It's `Calendar.Events.Insert.setConferenceDataVersion` – ziganotschka Apr 07 '20 at 15:11
  • Are there any different between eventNamedHangout and hangoutMeet? i tried hangoutMeet but it soesn't work but eventNamedHangout can. – 蘇柏綸 Apr 08 '20 at 07:13
  • The difference is your account. If you have a GSuite account - then you need to use `eventNamedHangout`. See [documentation about `conferenceData.createRequest.conferenceSolutionKey.type`](https://developers.google.com/calendar/v3/reference/events) – ziganotschka Apr 08 '20 at 07:27
  • But i use eventNamedHangout it create a meet (https://meet.google.com/) actually it's what i need but the document said that i should use hangoutMeet – 蘇柏綸 Apr 08 '20 at 08:20
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/211189/discussion-between-ziganotschka-and-). – ziganotschka Apr 08 '20 at 08:21