You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

MS Graph多搜索参数失效:查询昨日带附件邮件的正确格式?

正确的MS Graph多条件邮件查询格式

你之前的查询失效是因为$search参数的格式错误,正确的多条件写法需要把所有搜索逻辑放在同一组双引号内,用AND连接。

正确的请求URL(Graph Explorer直接可用)

https://graph.microsoft.com/v1.0/me/mailFolders/inbox/messages?$search="hasAttachments:true AND received:yesterday"&$expand=attachments

关键说明

  • $search参数的多条件必须合并在单个双引号中,不能给每个条件单独加引号,否则Graph会忽略逻辑连接符,只识别第一个条件。
  • 若在代码中调用,需要对URL中的空格和双引号进行URL编码,编码后的请求如下:
https://graph.microsoft.com/v1.0/me/mailFolders/inbox/messages?$search=%22hasAttachments%3Atrue%20AND%20received%3Ayesterday%22&$expand=attachments

内容的提问来源于stack exchange,提问作者RunRabbit

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.19 09:10:35