gpt4 book ai didi

json - Odata查询Outlook Rest API

转载 作者:行者123 更新时间:2023-12-04 04:16:10 25 4
gpt4 key购买 nike

如何在同一查询中使用搜索和过滤器?

String url = "https://outlook.office.com/api/v2.0/me/messages?$filter=ReceivedDateTime ge 2016-02-22&$select=Subject,From,Body,ReceivedDateTime&$search=\"subject:(Chris Brown OR Michael Jackson)\"";

我需要查找所有带有 Subject且具有“克里斯·布朗”或“迈克尔· jackson ”的邮件,并且邮件的接收日期为2016年2月22日之后。此外,REST响应中还应包含 SubjectFromBodyReceivedDateTime

谁能帮忙吗?

仅供引用-如果它具有 filtersearch,我将得到输出。但是一起使用时,出现“错误请求”错误。

最佳答案

目前不支持此功能。从Use OData query parameters:

You cannot use $filter or $orderby in a search request.



因此,执行此操作的唯一方法是通过查询执行搜索,然后在客户端上进行过滤。或相反亦然。

更新

在这种特殊情况下,由于主题是可过滤的,并且假设您只需要主题的完全匹配(例如,不需要“包含”),则可以使用以下方式:
https://outlook.office.com/api/v2.0/me/messages?$filter=(ReceivedDateTime ge 2016-02-22) and ((subject eq 'Chris Brown') or (subject eq 'Michael Jackson'))

关于json - Odata查询Outlook Rest API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37414771/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com