0

我正在尝试按发件人地址过滤我的 Outlook 365 收件箱。查看 OData 规范,我会通过它来查询复杂类型

https://outlook.office365.com/ews/odata/Me/Folders ('收件箱')/Messages?$filter=From/Address eq 'some@address.com'。

不幸的是,这会返回属性“地址”无效。

我可以确认我可以访问数据

如果我只是查询收件箱,则查看 JSON,我会看到一封电子邮件

...

"From": {

    "Name": "Some One",
    "Address": "some@address.com"

},

...

任何有关查询字符串的帮助将不胜感激

(ps我把地址弄错了)

4

2 回答 2

0

我可以重现您的失败,并且从堆栈跟踪中,它应该是服务问题。ODatalib 可以支持复杂类型的过滤器(可以查看http://services.odata.org/V4/OData/OData.svc/PersonDetails ?$filter=Address/City eq 'Boise'),但交换服务不支持。

"stacktrace": "   at Microsoft.Exchange.Services.OData.Model.ODataFilterConverter.GetEntityProperty(QueryNode queryNode)\r\n   at Microsoft.Exchange.Services.OData.Model.EwsFilterConverter.ConvertFilterNode(QueryNode queryNode)\r\n   at Microsoft.Exchange.Services.OData.Model.EwsQueryAdapter.GetRestriction()\r\n   at Microsoft.Exchange.Services.OData.Model.MessageProvider.Find(String parentFolderId, MessageQueryAdapter queryAdapter)\r\n   at Microsoft.Exchange.Services.OData.Model.FindMessagesCommand.InternalExecute()\r\n   at Microsoft.Exchange.Services.OData.ODataCommand`2.Execute()\r\n   at Microsoft.Exchange.Services.OData.ODataTask.Execute(TimeSpan queueAndDelayTime, TimeSpan totalTime)"
于 2014-07-09T11:43:44.963 回答
-1

尝试这个:

https://outlook.office365.com/ews/odata/Me/Folders('Inbox')/Messages?$filter=From/EmailAddress/Address eq 'some@address.com'.
于 2017-12-09T00:56:50.480 回答