如何访问安全与合规中心API(O365)

时间:2019-07-24 07:36:36

标签: php oauth-2.0 office365 postman microsoft-graph

我正在创建一个内部软件,旨在构建可以发送给客户的自动化报告。这些报告的某些数据当前包含在安全与合规性中心内。 (https://protection.office.com

我已经尝试过扭转邮递员中的两条路线,并使用登录的超级管理员用户的标头获得有效的json响应。问题是我不确定如何使用客户端应用程序以编程方式进行身份验证以访问此数据。

到目前为止,我使用的路线是这些2: https://protection.office.com/api/Report/GetReportSummaryData/?reportId=ATPPhishReport&dataSourceId=MailTrafficATPReport

https://protection.office.com/api/Report/GetReportSummaryData/?reportId=ATPAggregateLightReport&dataSourceId=MailTrafficATPReport

我使用的标题遵循这种格式,但是,如果您有权访问仪表板,则也应该能够获取它们。

:authority: protection.office.com
:method: POST
:path: /api/Report/GetReportSummaryData/?reportId=ATPAggregateLightReport&dataSourceId=MailTrafficATPReport
:scheme: https
accept: application/json, text/plain, */*
accept-encoding: gzip, deflate, br
accept-language: en-GB,en-US;q=0.9,en;q=0.8
content-length: 303
content-type: application/json;charset=UTF-8
cookie: MUID=CODE; s.SessID=CODE; .AspNet.Cookies=CODE; s.Flight=DD_20170657_EnableAppInsights,DD_20170622_EnableASRExclusionPage,DD_20170675_EnableDlpRemoveHeaderAction,DD_20170676_EnableDlpSetHeaderAction,DD_20170636_EnableNativeConnector,DD_20170684_EnableRecordsManagement,DD_20170661_EnableTiLitePhishExplorerUrlComponents,DD_20170660_EnableTiLitePhishUrlClicks; ai_user=CODE|TIME; X-EOP-ORIGINSERVER-eur03b.restapi.compliance.protection.outlook.com=CODE : CODE; XSRF-TOKEN=TOKEN; ai_session=CODE|CODE|CODE
dnt: 1
origin: https://protection.office.com
referer: https://protection.office.com/reportv2?id=ATPAggregateLightReport&pivot=EventType
request-context: appId=APP_ID
request-id: |CODE
user-agent: Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.142 Mobile Safari/537.36
x-clientpage: /reportv2
x-clientside-xhr-queue: psws-exo
x-xsrf-token: TOKEN

我找不到任何文档,但是我知道这是有可能的,因为我已经看到类似的服务在线提供此数据。

如果我可以授权使用这些当前路线,那将是成功的一半,因为我可以从那时开始将它们一起砍掉。

0 个答案:

没有答案