按主题行过滤的Outlook API仅返回275个结果

时间:2017-03-30 16:26:30

标签: outlook-restapi

我们一直在使用Outlook Mail API一段时间了。有一个已知的错误,按主题行过滤不会返回结果,并且已修复。

我们再次尝试了我们的实施,但每次上限为275。下面是我们正在运行的代码/查询的示例,您可以看到前两页有nextLink用于下一页但第三页停在75结果而没有nextLink。我们在多个帐户(所有30,000多封电子邮件)和不同的主题行查询中对此进行了测试,每次都获得275个结果。

search emails that contain 'a' in the subject
Request 1
{
  "$select": "ReceivedDateTime",
  "$search": "\"subject:(a)\"",
  "$top": 100
}

Response
result.value.length: 100
result.@odata.nextLink: https://outlook.office.com/api/v2.0/Me/MailFolders/Inbox/Messages/?%24select=ReceivedDateTime&%24search=%22subject%3a(a)%22&%24top=100&%24skiptoken=MSZZVlF3ZWsxNmJHMU5hbEY1V2xNd2VFOVVWVFZNVkZFMVQxZFZkRmxVUW0xTlV6RnNXWHByZWs1RVNtbFpNa2t5V1dwQmJXTjZNSGhOUkVFOQ%3d%3d -- this is the token for retrieveing the next page
Request 2
{
  "$select": "ReceivedDateTime",
  "$search": "\"subject:(a)\"",
  "$top": "100",
  "$skiptoken": "MSZZVlF3ZWsxNmJHMU5hbEY1V2xNd2VFOVVWVFZNVkZFMVQxZFZkRmxVUW0xTlV6RnNXWHByZWs1RVNtbFpNa2t5V1dwQmJXTjZNSGhOUkVFOQ=="
}

Response
result.value.length: 100
result.@odata.nextLink: 
https://outlook.office.com/api/v2.0/Me/MailFolders/Inbox/Messages/?%24select=ReceivedDateTime&%24search=%22subject%3a(a)%22&%24top=100&%24skiptoken=MSZZVlF3ZWsxNmJHMU5hbEY1V2xNd2VFOVVWVFZNVkZFMVQxZFZkRmxVUW0xTlV6RnNXWHByZWs1RVNtbFpNa2t5V1dwQmJXTjZNSGxOUkVFOQ%3d%3d
Request 3
{
  "$select": "ReceivedDateTime",
  "$search": "\"subject:(a)\"",
  "$top": "100",
  "$skiptoken": "MSZZVlF3ZWsxNmJHMU5hbEY1V2xNd2VFOVVWVFZNVkZFMVQxZFZkRmxVUW0xTlV6RnNXWHByZWs1RVNtbFpNa2t5V1dwQmJXTjZNSGxOUkVFOQ=="
}

Response
result.value.length: 75
result.@odata.nextLink: undefined  -- no next page

是否有其他人遇到此问题/是否有解决方法?谢谢!

1 个答案:

答案 0 :(得分:0)

邮箱的搜索组件将结果限制在较低级别。例如,如果使用OWA的搜索栏进行搜索,您会注意到会得到类似的结果。搜索小组正在对此进行反馈,以便在将来的计划中考虑,因此我建议您在UserVoice上留下反馈意见。我已经记录了一个工作项目以重新审视这个上限,但我无法做出任何承诺:)