通过 Rest Api 搜索租户级别的 Outlook [英] Tenant Level Search For Outlook via Rest Api

本文介绍了通过 Rest Api 搜索租户级别的 Outlook的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法搜索租户中的所有邮箱?不指定任何特定用户?我的目标是在租户的所有邮箱中搜索任何测试.

Is there a way to search across all mailboxes in a tenant ? without specifying any particular user? My goal is to search for any test across all mailboxes of a tenant.

我发现了这个链接:http://www.sharepointtalk.net/2015/02/getting-emails-with-attachments-from.html 使用 Sharepoint 的搜索 API 来搜索已登录用户的邮箱.

I came across this link a : http://www.sharepointtalk.net/2015/02/getting-emails-with-attachments-from.html which is using Sharepoint's search api to search on signed in user's mail boxes.

_api/search/query?querytext='contentclass:exchangeattachment'&properties='GraphQuery:ACTOR(ME)'

但是我遇到了这个错误:

But I got this error :

 {
"odata.error": {
"code": "-1, Microsoft.Office.Server.Search.REST.SearchServiceException",
"message": {
    "lang": "en-US",
    "value": "SPO graph API is deprecated."
  }
 }
}

如果我从 api 调用中删除属性",则没有搜索结果.我们可以访问吗,我们是否需要任何特殊权限才能使用 Sharepoint Search Rest API 来搜索 Outlook 消息?我们可以使用这个 api 跨租户搜索

If I remove the 'properties' from api call, there are no search results. Can we access and do we need any special permissions to use Sharepoint Search Rest API to search on outlook messages ? and can we search across tenant using this api

我知道我们可以使用这个 api graph api 调用来搜索消息:

I know we can search on messages using this api graph api call :

https://graph.microsoft.com/v1.0/users//messages?$search="";但我希望搜索工作独立于登录用户.这可能吗 ?谢谢.

https://graph.microsoft.com/v1.0/users//messages?$search="" But I want the search to work independent of the signed in user. is this possible ? Thanks.

推荐答案

请仔细阅读此document 了解何时可以从/messages 端点获取数据,是的,您可以使用应用程序权限在没有用户的情况下查看消息登录,但它仍然是个人邮箱,您可以使用 Microsoft Graph 进行但不能在租户级别进行搜索.

Please go through this document to know when you can get the data from /messages endpoint and yes you can use application permissions to look into messages without user login but its still individual mailboxes you can do but not at tenant level searching using Microsoft Graph.

这篇关于通过 Rest Api 搜索租户级别的 Outlook的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆