我们已经使用Microsoft Graph API将Outlook与我们的iOS应用程序集成在一起。 我们有一个用例,我们必须通过附件名称或主题过滤Outlook消息。 我们正在使用查询参数来打图API。
链接到Microsoft文档。
根据上述文档, $search参数用于过滤Outlook邮件。 什么时候在API下面,我们得到错误的回应。 它会返回邮件主题和邮件正文中都含有“测试邮件”的邮件。 但它应该只返回主题为“测试邮件”的邮件。
https://graph.microsoft.com/v1.0/me/messages?$search="subject:Test Mail”当我们通过点击下面的API来按附件名称过滤邮件时,我们遇到了同样的问题。 事实上,我们在这种情况下得到了一个空的回应。
https://graph.microsoft.com/v1.0/me/messages?$search=“attachments:test.png”上述URL形成是否正确? 为什么我们没有得到期望的回应? 请帮助我们解决这个问题。
We have integrated outlook to our iOS application using Microsoft Graph API. We have a use case where we have to filter outlook messages by attachment name or by subject. We are using query parameters to hit graph API.
Link to microsoft documentation.
As per above documentation, $search parameter is used to filter outlook messages. When are hitting below API, we are getting wrong responses. It’s returning messages which have “Test Mail” in both subject and message body. But it should return only the messages whose subject line is “Test Mail”.
https://graph.microsoft.com/v1.0/me/messages?$search="subject:Test Mail”The same problem we are facing when we filter messages by attachment name, by hitting below API. In fact we are getting a empty response in this case.
https://graph.microsoft.com/v1.0/me/messages?$search=“attachments:test.png”Is the above URL formation is correct? Why we’re not getting desired response? Please help us out on this.
最满意答案
仅用于搜索主题,您可以使用:
/v1.0/me/messages?$search="subject:search term"或过滤器:
/v1.0/me/messages?$filter=contains(subject, 'my search term')(在这种方法中,搜索项必须与主题字符串的一部分完全匹配)
仅用于搜索附件,您必须使用关键字“附件”而不是“附件”( 交换文档 ):
/v1.0/me/messages?$search="attachment:search term"For searching Subject only, you can use:
/v1.0/me/messages?$search="subject:search term"or a filter:
/v1.0/me/messages?$filter=contains(subject, 'my search term')(in this method the search term must exactly match a portion of the subject string)
For searching attachments only, you must use the keyword 'attachment' instead of 'attachments' (exchange documentation):
/v1.0/me/messages?$search="attachment:search term"更多推荐
发布评论