how to get all events from google calendar using google calendar API

ぐ巨炮叔叔 提交于 2019-12-11 12:34:44

问题


With reference of this I have made a application which gets information from google calendar event using google api. I have used the same code given in above URL.

Now there is one calendar with 2 calendar name like ME and XYZ. If I use my email Id then I only got the details of event with Calendar = "ME". I have used below code

            EventsResource.ListRequest request = service.Events.List("primary");
            request.TimeMin = dtStart;
            request.TimeMax = dtEnd;
            request.ShowDeleted = false;
            request.SingleEvents = true;
            request.OrderBy = EventsResource.ListRequest.OrderByEnum.StartTime;
            Events events = request.Execute();

How to get all the events details?


回答1:


Events: list

Returns events on the specified calendar.

HTTP request

GET https://www.googleapis.com/calendar/v3/calendars/calendarId/events

As you can see from the documentation Events.list returns the events for A calendar. If you have more then one calendar then you will need to request the events for that calendar as well.

Tip: You might want to look at

CalendarList: list Returns entries on the user's calendar list.

This will return a list of the calendars the user has access to then you can loop though the events on each one of them.



来源:https://stackoverflow.com/questions/35169118/how-to-get-all-events-from-google-calendar-using-google-calendar-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!