Programmatically generate a Google Meet link
Asked Answered
W

1

36

I'm looking to start a Google Meet meeting by calling an API that returns the new meeting URL.

It looks like this may be possible if I create a new meeting using the calendar API, but it'd be nice if that wasn't necessary.

Wainscoting answered 19/11, 2017 at 23:10 Comment(4)
Did you get this working?See
Never did, nope.Wainscoting
Hey @Wainscoting still no luck? I was thinking that since there is no API i might use pupeteer, however the 2FA will be a pain to handleCuthburt
Check out #61216547Quadrifid
V
0

I think you need to bite the pullet and use the google calendar API, as specified here:

Programmatically generate a Google Meet link

I'll give a quick code example (in Java - my preferred language), but you have to add the authentication stuff and everything.

Also check the API documentation at: https://developers.google.com/calendar/api/v3/reference/events

And also check the API github client page, e.g. for java it is: https://github.com/googleapis/google-api-java-client-services#google-java-api-client-services

 Event event = new Event()
                    .setSummary("Test")
                    .setDescription("Meeting created by API")
                    .setStart(new EventDateTime().setDateTime(new DateTime("2024-07-01T10:00:00-00:00")).setTimeZone("America/Los_Angeles"))
                    .setEnd(new EventDateTime().setDateTime(new DateTime("2024-07-01T11:30:00-07:00")).setTimeZone("America/Los_Angeles"))
                    .setAttendees(Collections.singletonList(new EventAttendee().setEmail("[email protected]")));

            ConferenceData conferenceData = new ConferenceData();
            CreateConferenceRequest createConferenceRequest = new CreateConferenceRequest();
            ConferenceSolutionKey conferenceSolutionKey = new ConferenceSolutionKey().setType("hangoutsMeet");
            event.setConferenceData(conferenceData);

            Event createdEvent = service.events().insert("primary", event).setConferenceDataVersion(1).execute();
            logger.info("Event created: {}", createdEvent.getHtmlLink());
            logger.info("Google Meet Link: {}", createdEvent.getConferenceData().getEntryPoints().get(0).getUri());
       

If you prefer Nodejs, see the wonderful answer here: Inserting an Event with Google Calendar API with a Hangout Conference attached

Disclaimer: I might have some errors in my code as I didn't have time to test it.

Vookles answered 3/6 at 14:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.