Outlook – 阅读另一个用户的日历

我正在开发基于Outlook-SDK-Android的Android应用程序。 该应用程序与Outlook日历REST API会谈,以检索,预订和删除事件(请参阅此处和这里的代码示例)。 现在我需要阅读别人的日历,并且已经向其他用户提供了具有委托访问( 作者权限级别 )的Office365帐户。

我已经使用新门户上提供的帐户注册了我的应用程序。 在我的应用程序中,我使用范围“ https://outlook.office.com/Calendars.ReadWrite ”。 (该范围用于com.microsoft.aad.adal.AuthenticationContext.acquireToken() 为Android OutlookClient(由orc-for-android提供的共享客户端堆栈初始化Office REST客户端 )

当我尝试读取另一个用户的日历时,我只能收到一个403响应:

{ "error": { "code": "ErrorAccessDenied", "message": "Access is denied. Check credentials and try again." } } 

任何帮助?

这是API的限制吗? 如果是这样,为什么提供下面的方法调用链呢?

 outlookClient.getUsers() .getById("meetingRoom@company.com") .getCalendarView() 

更新:

似乎有正在进行的工作 ,将允许这种情况下,这里报告: Office 365 REST API – 访问会议室日历

所以如果在这方面取得进展,我可以在不使用“ pipe理服务应用程序 ”的情况下实现自己的目标吗? (请参阅Office 365 API或Azure AD Graph API – 获取某人Elses日历 )

我可以使用这里build议的基本身份validation吗?

日历委派是Exchange的一项function,Graph API和Outlook API不允许用户访问委托日历。 目前,替代解决方法可以使用EWS。 这里有一个供你参考的例子:

 static void DelegateAccessSearchWithFilter(ExchangeService service, SearchFilter filter) { // Limit the result set to 10 items. ItemView view = new ItemView(10); view.PropertySet = new PropertySet(ItemSchema.Subject, ItemSchema.DateTimeReceived, EmailMessageSchema.IsRead); // Item searches do not support deep traversal. view.Traversal = ItemTraversal.Shallow; // Define the sort order. view.OrderBy.Add(ItemSchema.DateTimeReceived, SortDirection.Descending); try { // Call FindItems to find matching calendar items. // The FindItems parameters must denote the mailbox owner, // mailbox, and Calendar folder. // This method call results in a FindItem call to EWS. FindItemsResults<Item> results = service.FindItems( new FolderId(WellKnownFolderName.Calendar, "fx@msdnofficedev.onmicrosoft.com"), filter, view); foreach (Item item in results.Items) { Console.WriteLine("Subject: {0}", item.Subject); Console.WriteLine("Id: {0}", item.Id.ToString()); } } catch (Exception ex) { Console.WriteLine("Exception while enumerating results: { 0}", ex.Message); } } private static void GetDeligateCalendar(string mailAddress, string password) { ExchangeService service = new ExchangeService(); service.Credentials = new WebCredentials(mailAddress, password); service.TraceEnabled = true; service.TraceFlags = TraceFlags.All; service.AutodiscoverUrl(mailAddress, RedirectionUrlValidationCallback); SearchFilter sf = new SearchFilter.SearchFilterCollection(LogicalOperator.And, new SearchFilter.IsEqualTo(AppointmentSchema.Subject, "Discuss the Calendar REST API")); DelegateAccessSearchWithFilter(service, sf); } 

如果您希望Outlook和图表API支持此function,则可以尝试通过以下链接联系Office开发人员小组:

https://officespdev.uservoice.com/

FindMeetingTimes目前正在预览! 要查看详细信息,请使用此链接,然后将其更改为查看文章的Beta版本(在主列的右上angular): https : //msdn.microsoft.com/en-us/office/office365/api/calendar -rest的操作#Findmeetingtimespreview

从文章下面的细节,但请使用链接获取最新的:

查找会议时间(预览)

根据组织者和与会者的可用性以及时间或地点限制查找会议时间build议。

此操作目前处于预览状态,仅在testing版本中提供。

所有受支持的scheme都使用FindMeetingTimes操作。 FindMeetingTimes接受在请求正文中指定为参数的约束,并检查组织者和与会者的主日历中的忙/闲状态。 答复包括会议时间build议,每个build议都被定义为MeetingTimeCandidate,参加者平均有50%的机会或更高的可信度参加。