android日历读取账号,android – Outlook – 读取另一个用户的日历

本文探讨了如何使用EWS API获取Exchange的日历委派信息,由于GraphAPI和Outlook API当前限制,提供了工作示例。同时呼吁开发者关注并推动Outlook和GraphAPI对委派日历的支持。
摘要由CSDN通过智能技术生成

日历委派是Exchange的一项功能,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 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开发人员团队:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值