简体   繁体   English

当我们检查接收时间更长时,带有 $search 过滤器的 Microsoft Graph Mail API 不起作用

[英]Microsoft Graph Mail API with $search filter not working when we check received time is greater

I am working with我正在与

Microsoft Graph API微软图形 API

I have a requirement to get emails with different filters and with the specified time range.我需要使用不同的过滤器和指定的时间范围来获取电子邮件。 I am using Odata query for the filter, a couple of examples are:我正在使用 Odata 查询作为过滤器,几个例子是:

https://graph.microsoft.com/v1.0/users/<Email-id>/<folder-id>/messages?$search="received>2019-07-02T07:16:39.094Z AND received<2019-07-02T07:17:39.095Z AND isRead=false"


https://graph.microsoft.com/v1.0/users/<Email-id>/<folder-id>/messages?$search="received>2019-07-02T07:16:39.094Z AND received<2019-07-02T07:17:39.095Z AND isRead=false AND body:testbody"

Till the morning it was working fine, but now I am facing the 504 Gateway timeout issue直到早上它都运行良好,但现在我面临504 网关超时问题

{
"error": {
    "code": "UnknownError",
    "message": "",
    "innerError": {
        "request-id": "f3ecaf3d-e9c2-4b99-8a01-224de9852d57",
        "date": "2019-07-02T11:38:20"
    }
}

After spending some time I observed there is an issue with below filter with the greater sign.花了一些时间后,我观察到以下过滤器存在问题,符号较大。

received>2019-07-02T07:16:39.094Z

If I remove this, then this will work fine.如果我删除它,那么这将正常工作。 It works fine with the less sign as well.它也适用于 less 符号。

received<2019-07-02T07:17:39.095Z

Any idea team why it stops working?任何想法团队为什么停止工作?

The graph api doesn't like the > in the url.图 api 不喜欢 url 中的 >。 Just replace it with gt .只需将其替换为gt

received gt 2021-01-01...

Complete sample on the odata documentation page. odata文档页面上的完整示例。

https://developer.microsoft.com/graph/graph-explorer?request=me/mailFolders/inbox/messages?$filter=ReceivedDateTime+ge+2017-04-01+and+receivedDateTime+lt+2017-05-01&method=GET&version=v1.0

I would just combine both the $search and filter parameter.我只想结合 $search 和 filter 参数。

See this answer https://stackoverflow.com/a/64134415/639153请参阅此答案https://stackoverflow.com/a/64134415/639153

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Microsoft Graph API - 访问邮件时出现身份验证错误 - Microsoft Graph API - AuthenticationError when accessing mail Microsoft Graph Rest API - 按过去 X 天过滤 - Microsoft Graph Rest API - Filter by last X days Microsoft Graph API 过滤器 SharePoint 按用户创建的列表项 - Microsoft Graph API Filter SharePoint List Items By CreatedBy User Microsoft Graph API选择并过滤日历中的所有者地址 - Microsoft Graph API Select and Filter Owner Address in Calendar Microsoft Graph API - 检查用户是否拥有 SharePoint 许可证 - Microsoft Graph API - Check if user has a SharePoint license $select 参数不适用于 Microsoft Graph API 共享日历 (cURL) - $select parameter not working on Microsoft Graph API share calendar (cURL) 尝试对Microsoft Azure Graph进行OAUTH身份验证WebClient时收到403错误 - 403 error received when trying to OAUTH authenticate WebClient against Microsoft Azure Graph 没有用户委派时如何使用OAuth? — Microsoft Graph API - How to use OAuth when there is no user delegation? — Microsoft Graph API 将请求发布到 Microsoft graph API - Post request to Microsoft graph API Microsoft Graph筛选器共享的OneDrive文件 - Microsoft Graph Filter shared OneDrive files
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM