[英]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.