Joseph Michael
Joseph Michael

Reputation: 77

Get Calendar ID of Event in Google Calendar API C#

Is there a way to get the Calendar ID of an event in Google Calendar through the Event class?

        var credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
        new ClientSecrets
        {
            ClientId = "1079676878296-hga8cb7jgk2lmprishaiiul8vkutu33b.apps.googleusercontent.com",
            ClientSecret = "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",
        },
        new[] { CalendarService.Scope.Calendar },
        CalendarAccount,
        CancellationToken.None).Result;

        var service = new CalendarService(new BaseClientService.Initializer
        {
            HttpClientInitializer = credential,
            ApplicationName = "Custom CRM",
        });

        var recurringEvent = service.Events.Get(eventid);

        recurringEvent.Execute().Summary

Like where I can do recurringEvent.Execute().Summary,
Is there a way to do recurringEvent.Execute().CalendarID?

Upvotes: 1

Views: 587

Answers (1)

Linda Lawton - DaImTo
Linda Lawton - DaImTo

Reputation: 116918

The execute method returns the event object.

var result = recurringEvent.Execute();
result.Id

Upvotes: 1

Related Questions