
我正在开发基于Outlook-SDK-Android的AndroID应用程序.该应用程序与Outlook Calendar REST API进行对话以检索,预订和删除事件(请参阅代码示例here和here).现在我需要阅读其他人的日历,并且我已经向其他用户提供了具有委托访问权限(author permission level)的Office365帐户.
我已经使用new portal上提供的帐户注册了我的应用程序.在我的应用程序中,我使用范围“https://outlook.office.com/Calendars.ReadWrite”.
(该范围在com.microsoft.aad.adal.AuthenticationContext.acquiretoken()中用于初始化Office REST Client for Android OutlookClIEnt,即orc-for-android提供的共享客户端堆栈)
当我尝试读取我有委托访问权限的另一个用户的日历时,我只收到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 – Access meeting rooms calendars
因此,如果在这方面取得进展,我可以在不使用“admin service app”的情况下实现我的目标吗? (见Office 365 API or Azure AD Graph API – Get Someone Elses Calendar)
我可以使用here建议的基本身份验证吗?
解决方法:
日历委派是Exchange的一项功能,Graph API和Outlook API不允许用户访问委派的日历.@H_404_35@目前,替代解决方法可以使用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和Graph API支持此功能,您可以尝试通过以下链接联系Office开发人员团队:
https://officespdev.uservoice.com/
总结以上是内存溢出为你收集整理的android – Outlook – 读取另一个用户的日历全部内容,希望文章能够帮你解决android – Outlook – 读取另一个用户的日历所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)