3

I'm trying to create the Google Calendar event with the conference(Google Meet) using Java SDK V3. The event is getting created but the conference details are not being set. Not sure what's missing

Create request:

Calendar service = new Calendar
            .Builder(GoogleNetHttpTransport.newTrustedTransport(),
            getDefaultInstance(),
            new HttpCredentialsAdapter(googleCalendarCredentials()))
            .setApplicationName(APPLICATION_NAME)
            .build();

    Event event = new Event();

    event.setStart(new EventDateTime().setDateTime(new DateTime(currentTimeMillis())));
    event.setEnd(new EventDateTime().setDateTime(new DateTime(currentTimeMillis() + 10000000)));

    ConferenceData conferenceData = new ConferenceData();

    conferenceData.setCreateRequest(
            new CreateConferenceRequest()
                    .setConferenceSolutionKey(
                            new ConferenceSolutionKey()
                                    .setType("hangoutsMeet")));

    event.setConferenceData(conferenceData);

    service.events().insert("primary", event).execute();

Get Request:

Events events = service.events()
            .list("primary")
            .execute();

    List<Event> items = events.getItems();

    if (items.isEmpty()) {
        System.out.println("No upcoming events found.");
    } else {
        System.out.println("Upcoming events");

        for (Event eventRs : items) {
            System.out.printf("%s\n", eventRs.getConferenceData().getConferenceId());
        }
    }

Getting eventRs.getConferenceData() as null.

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
Eswar Karumuri
  • 129
  • 2
  • 10

1 Answers1

1

If you check the documentaiton on Event.insert you will see that you need to set the option parameter conferenceDataVersion inorder to enable it to set the conference data.

enter image description here

Version 0 assumes no conference data support and ignores conference data in the event's body. Version 1 enables support for copying of ConferenceData

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449
  • 1
    I've tried the following but still getting eventRs.getConferenceData() as null. **service.events().insert("primary", event) .setConferenceDataVersion(1) .execute();** – Eswar Karumuri May 22 '20 at 07:13