我最近开始使用Office365API,现在可以对成功进行身份验证并获得令牌。现在,我想查询用户的Exchange的会议。为此,我从这里运行示例查询
var client = new OutlookServicesClient(new Uri("https://outlook.office.com/api/2.0"), async () =>
{
// Since we have it locally from the Session, just return it here.
return token;
});
var eventResults = await client.Me.Events.OrderByDescending(e => e.Start).Take(10).Select(e => new DisplayEvent(e.Subject, e.Start.ToString(), e.End.ToString())).ExecuteAsync();
// query: https://outlook.office.com/api/2.0/Me/Events?$orderby=Start%%20desc&$top=10&$select=Subject,Start,End 不幸的是,这将返回以下错误(500):Server Error in '/API' Application. Constructor on type 'Microsoft.Exchange.Services.OData.Web.HttpHandler' not found.
在搜索时,我发现了一些类似的错误(这里和这里)。当时服务器好像出了问题。但是,由于API相当成熟,我认为我做的是错误的事情,而不是服务器错误。
编辑:在https://oauthplay.azurewebsites.net/上测试查询也会导致相同的错误,而示例查询可以工作。
有人知道我做错了什么吗?
发布于 2015-12-09 13:24:24
结果发现,.NET入门日历代码中有一个错误,它为OutlookServicesClient对象的构造函数使用了一个糟糕的URI。这一行应改为:
OutlookServicesClient client = new OutlookServicesClient(
new Uri("https://outlook.office.com/api/v2.0"),该示例在URI中丢失了v,这导致了错误。
https://stackoverflow.com/questions/34163445
复制相似问题