Office365 是否有一种方法可以在office 365 API中的一次调用中从所有用户日历(默认日历和其他日历)获取事件。
在office 365 API中,我没有发现任何一个服务可以在一次调用中返回来自用户日历的所有事件。 若用户有3个日历,那个么需要通过传递日历Id进行三次调用 首先需要通过调用获取日历IDOffice365 是否有一种方法可以在office 365 API中的一次调用中从所有用户日历(默认日历和其他日历)获取事件。,office365,office365api,Office365,Office365api,在office 365 API中,我没有发现任何一个服务可以在一次调用中返回来自用户日历的所有事件。 若用户有3个日历,那个么需要通过传递日历Id进行三次调用 首先需要通过调用获取日历ID https://outlook.office.com/api/v1.0/me/calendars GET https://outlook.office.com/api/{version}/me/calendars/{calendar_id}/calendarview?startDateTime={start
https://outlook.office.com/api/v1.0/me/calendars
GET https://outlook.office.com/api/{version}/me/calendars/{calendar_id}/calendarview?startDateTime={start_datetime}&endDateTime={end_datetime}
然后,对于每个日历Id,需要通过调用
https://outlook.office.com/api/v1.0/me/calendars
GET https://outlook.office.com/api/{version}/me/calendars/{calendar_id}/calendarview?startDateTime={start_datetime}&endDateTime={end_datetime}
如果有任何一个电话,那么将减少往返
谢谢您的帮助。不,没有一个电话可以查看所有日历的“合并”视图。这是一个有趣的想法,我认为你应该发布它。的确,我们不能在一次点击中点击多个日历,但是我们可以使用并行foreach同时调用以获得更快的响应
Task[] CalendarListEvents = new Task[CalendarList.Count];
Parallel.ForEach(CalendarList, (Calendar) =>
{
tasksToFetchDailyEvents[index] = Task.Factory.StartNew(() =>
{
// Code to fetch Events and add to list
});
});
Task.WaitAll(CalendarListEvents);
好的,再次感谢你的快速回答。谢谢。