Office 365 服务通信 API 参考

2021/8/11

本文内容

重要

Microsoft Graph 中的服务运行状况和通信 API 现已推出。 Microsoft Graph API 替换本文中所述的服务通信 API。 我们将从 2021 年 12 月 17 日开始停用旧版服务通信 API。 有关新 Microsoft Graph API 的详细信息,请参阅通过 Microsoft Graph 访问服务运行状况和通信的概述。

Office 365 服务通信 API V2 可用于访问以下数据:

获取服务:获取已订阅服务的列表。

获取当前状态:获取当前正在进行的服务事件的实时视图。

获取历史记录状态:获取服务事件的历史视图。

获取消息:查找事件和消息中心通信。

目前,Office 365 服务通信 API 包含 Office 365、Yammer、Dynamics CRM 和 Microsoft Intune 云服务的数据。

基础知识

此 API 的根 URL 包含将操作范围限定为一个租户的租户标识符:

https://manage.office.com/api/v1.0/{tenant_identifier}/ServiceComms/{operation}

借助 Office 365 服务通信 API 这项 REST 服务,可开发使用任何 Web 语言和宿主环境(支持 HTTPS 和 X.509 证书)的解决方案。 此 API 依赖 Microsoft Azure Active Directory 和 OAuth2 协议进行身份验证和授权。 若要在应用程序中访问此 API,必须先在 Azure AD 中注册应用程序,并为它配置适当范围的权限。 这样,应用程序便能请求获取调用此 API 所需的 OAuth2 访问令牌。 若要详细了解如何在 Azure AD 中注册和配置应用程序,请参阅 Office 365 管理 API 入门。

所有 API 请求都要求,授权 HTTP 头中必须有从 Azure AD 中获取的包含 ServiceHealth.Read 声明的有效 OAuth2 JWT 访问令牌;且租户标识符必须与根 URL 中的租户标识符一致。

Authorization: Bearer {OAuth2 token}

请求标头

以下是所有 Office 365 服务通信 API 操作支持的请求头。

说明

Accept(可选)

以下是可接受的响应表示形式:

application/json;odata.metadata=full

application/json;odata.metadata=minimal

[The default if header not specified] application/json;odata.metadata=none

Authorization(必需)

请求的授权令牌(持有者 JWT Azure AD 令牌)。

响应标头

以下是所有 Office 365 服务通信 API 操作返回的响应头:

说明

Content-Length

响应正文长度。

Content-Type

响应表示形式:

application/json

application/json;odata.metadata=full

application/json;odata.metadata=minimal

application/json;odata.metadata=none

odata.streaming=true

Cache-Control

用于指定请求/响应链上的所有缓存机制都必须遵守的指令。

Pragma

实现专属行为。

Expires

客户端何时应让资源到期。

X-Activity-Id

服务器生成的活动 ID。

OData-Version

受支持的 OData 版本 (4.0)。

Date

服务器发送响应的日期 (UTC)。

X-Time-Taken

响应生成耗时(以毫秒为单位)。

X-Instance-Name

用于生成响应的 Azure 实例的标识符(用于调试目的)。

Server

用于生成响应的服务器(用于调试目的)。

X-ASPNET-Version

生成响应的服务器使用的 ASP.Net 版本(用于调试目的)。

X-Powered-By

生成响应的服务器使用的技术(用于调试目的)。

下文介绍了 Office 365 服务通信 API 操作。

获取服务

返回已订阅服务的列表。

信息

服务

说明

路径

/Services

查询选项

$select

选择一部分属性。

响应

“Service”实体列表

“Service”实体包含“Id”(String)、“DisplayName”(String) 和“FeatureNames”(String 列表)。

示例请求

GET https://manage.office.com/api/v1.0/contoso.com/ServiceComms/Services

Authorization: Bearer {AAD_Bearer_JWT_Token}

示例响应

{

"value": [

{

"Id": "Exchange",

"DisplayName": "Exchange Online",

"FeatureNames": [

"Sign-in",

"E-Mail and calendar access",

"E-Mail timely delivery",

"Management and Provisioning",

"Voice mail"

]

},

{

"Id": "Lync",

"DisplayName": "Lync Online",

"FeatureNames": [

"Audio and Video",

"Federation",

"Management and Provisioning",

"Sign-In",

"All Features",

"Dial-In Conferencing",

"Online Meetings",

"Instant Messaging",

"Presence",

"Mobility"

]

}

]

}

获取当前状态

返回过去 24 小时的服务状态。

备注

服务响应将包含过去 24 小时内的状态和所有事件。 返回的 StatusDate 或 StatusTime 值将正好是过去 24 小时。 若要获取特定事件的最近一次更新信息, 请使用 "获取消息" 功能并从与事件 ID 匹配的响应记录中读取 LastUpdatedTime 值。

信息

服务

说明

路径

/CurrentStatus

筛选器

Workload

按 Workload 筛选(String,默认值:all)。

查询选项

$select

选择一部分属性。

响应

“WorkloadStatus”实体列表。

“WorkloadStatus”实体包含“Id”(String)、“Workload”(String)、“StatusTime”(DateTimeOffset)、“WorkloadDisplayName”(String)、“Status”(String)、“IncidentIds”(String 列表)和“FeatureGroupStatusCollection”(“FeatureStatus”列表)。

“FeatureStatus”实体包含“Feature”(String)、“FeatureGroupDisplayName”(String) 和“FeatureStatus”(String)。

示例请求

GET https://manage.office.com/api/v1.0/contoso.com/ServiceComms/CurrentStatus

Authorization: Bearer {AAD_Bearer_JWT_Token}

示例响应

{

"value": [

{

"Id": "Exchange",

"Workload": "Exchange",

"StatusDate": "2015-04-11T00:00:00Z",

"WorkloadDisplayName": "Exchange Online",

"Status": "ServiceOperational",

"IncidentIds": [],

"FeatureGroupStatusCollection": [

{

"Feature": "Signin",

"FeatureGroupDisplayName": "Sign-in",

"FeatureStatus": "ServiceOperational"

},

{

"Feature": "Access",

"FeatureGroupDisplayName": "E-Mail and calendar access",

"FeatureStatus": "ServiceOperational"

},

{

"Feature": "Delivery",

"FeatureGroupDisplayName": "E-Mail timely delivery",

"FeatureStatus": "ServiceOperational"

},

{

"Feature": "Provisioning",

"FeatureGroupDisplayName": "Management and Provisioning",

"FeatureStatus": "ServiceOperational"

},

{

"Feature": "UnifiedMessaging",

"FeatureGroupDisplayName": "Voice mail",

"FeatureStatus": "ServiceOperational"

}

]

},

{

"Id": "Lync",

"Workload": "Lync",

"StatusDate": "2015-04-11T00:00:00Z",

"WorkloadDisplayName": "Lync Online",

"Status": "ServiceOperational",

"IncidentIds": [],

"FeatureGroupStatusCollection": [

{

"Feature": "AudioVideo",

"FeatureGroupDisplayName": "Audio and Video",

"FeatureStatus": "ServiceOperational"

},

{

"Feature": "Federation",

"FeatureGroupDisplayName": "Federation",

"FeatureStatus": "ServiceOperational"

},

{

"Feature": "ManagementandProvisioning",

"FeatureGroupDisplayName": "Management and Provisioning",

"FeatureStatus": "ServiceOperational"

},

{

"Feature": "Sign-In",

"FeatureGroupDisplayName": "Sign-In",

"FeatureStatus": "ServiceOperational"

},

{

"Feature": "All",

"FeatureGroupDisplayName": "All Features",

"FeatureStatus": "ServiceOperational"

},

{

"Feature": "DialInConferencing",

"FeatureGroupDisplayName": "Dial-In Conferencing",

"FeatureStatus": "ServiceOperational"

},

{

"Feature": "OnlineMeetings",

"FeatureGroupDisplayName": "Online Meetings",

"FeatureStatus": "ServiceOperational"

},

{

"Feature": "InstantMessaging",

"FeatureGroupDisplayName": "Instant Messaging",

"FeatureStatus": "ServiceOperational"

},

{

"Feature": "Presence",

"FeatureGroupDisplayName": "Presence",

"FeatureStatus": "ServiceOperational"

},

{

"Feature": "Mobility",

"FeatureGroupDisplayName": "Mobility",

"FeatureStatus": "ServiceOperational"

}

]

}

]

}

状态定义

状态定义包括以下值:

正在调查

ServiceDegradation

ServiceInterruption

RestoringService

ExtendedRecovery

InvestigationSuspended

ServiceRestored

FalsePositive

PostIncidentReportPublished

ServiceOperational

获取历史状态

按天返回服务在特定时间范围内的历史状态。

信息

服务

说明

路径

/HistoricalStatus

筛选器

Workload

按 Workload 筛选(String,默认值:all)。

StatusTime

按晚于 StatusTime 的天数进行筛选(DateTimeOffset,默认值:ge CurrentTime - 7 days)。

查询选项

$select

选择一部分属性。

响应

“WorkloadStatus”实体列表。

“WorkloadStatus”实体包含“Id”(String)、“Workload”(String)、“StatusTime”(DateTimeOffset)、“WorkloadDisplayName”(String)、“Status”(String)、“IncidentIds”(String 列表)和“FeatureGroupStatusCollection”(“FeatureStatus”列表)。

“FeatureStatus”实体包含“Feature”(String)、“FeatureGroupDisplayName”(String) 和“FeatureStatus”(String)。

示例请求

GET https://manage.office.com/api/v1.0/contoso.com/ServiceComms/HistoricalStatus

Authorization: Bearer {AAD_Bearer_JWT_Token}

示例响应

{

"value": [

{

"Id": "Exchange",

"Workload": "Exchange",

"StatusDate": "2015-04-11T00:00:00Z",

"WorkloadDisplayName": "Exchange Online",

"Status": "ServiceOperational",

"IncidentIds": [],

"FeatureGroupStatusCollection": [

{

"Feature": "Signin",

"FeatureGroupDisplayName": "Sign-in",

"FeatureStatus": "ServiceOperational"

},

{

"Feature": "Access",

"FeatureGroupDisplayName": "E-Mail and calendar access",

"FeatureStatus": "ServiceOperational"

},

{

"Feature": "Delivery",

"FeatureGroupDisplayName": "E-Mail timely delivery",

"FeatureStatus": "ServiceOperational"

},

{

"Feature": "Provisioning",

"FeatureGroupDisplayName": "Management and Provisioning",

"FeatureStatus": "ServiceOperational"

},

{

"Feature": "UnifiedMessaging",

"FeatureGroupDisplayName": "Voice mail",

"FeatureStatus": "ServiceOperational"

}

]

},

{

"Id": "Exchange",

"Workload": "Exchange",

"StatusDate": "2015-04-10T00:00:00Z",

"WorkloadDisplayName": "Exchange Online",

"Status": "InformationAvailable",

"IncidentIds": [

"EX20870"

],

"FeatureGroupStatusCollection": [

{

"Feature": "Signin",

"FeatureGroupDisplayName": "Sign-in",

"FeatureStatus": "ServiceOperational"

},

{

"Feature": "Access",

"FeatureGroupDisplayName": "E-Mail and calendar access",

"FeatureStatus": "ServiceOperational"

},

{

"Feature": "Delivery",

"FeatureGroupDisplayName": "E-Mail timely delivery",

"FeatureStatus": "ServiceOperational"

},

{

"Feature": "Provisioning",

"FeatureGroupDisplayName": "Management and Provisioning",

"FeatureStatus": "ServiceOperational"

},

{

"Feature": "UnifiedMessaging",

"FeatureGroupDisplayName": "Voice mail",

"FeatureStatus": "InformationAvailable"

}

]

}

]

}

获取消息

返回特定时间范围内关于服务的消息。 使用类型筛选器,以筛选出“服务事件”、“计划内维护”或“消息中心”消息。

信息

服务

说明

路径

/Messages

筛选器

Workload

按 Workload 筛选(String,默认值:all)。

StartTime

按 StartTime 筛选(DateTimeOffset,默认值:ge CurrentTime - 7 days)。

EndTime

按 EndTime 筛选(DateTimeOffset,默认值:le CurrentTime)。

MessageType

按 MessageType 筛选(String,默认值:all)。

Id

按 ID 筛选(String,默认值:all)。

查询选项

$select

选择一部分属性。

$top

选择前多少个结果(默认值和最大值:$top = 100)。

$skip

跳过的结果数(默认值:$skip = 0)。

响应

“Message”实体列表。

“Message”实体包含“Id”(String)、“StartTime”(DateTimeOffset)、“EndTime”(DateTimeOffset)、“Status”(String)、“Messages”(“MessageHistory”实体列表)、“LastUpdatedTime”(DateTimeOffset)、“Workload”(String)、“WorkloadDisplayName”(String)、“Feature”(String)、“FeatureDisplayName”(String) 和“MessageType”(Enum,默认值:all)。

“MessageHistory”实体包含“PublishedTime”(DateTimeOffset) 和“MessageText”(String)。

示例请求

GET https://manage.office.com/api/v1.0/contoso.com/ServiceComms/Messages

Authorization: Bearer {AAD_Bearer_JWT_Token}

示例响应

{

"value": [

{

"Id": "EX20119",

"Name": "EX20119",

"Title": null,

"StartTime": "2015-04-01T22:25:00Z",

"EndTime": "2015-04-07T21:48:00Z",

"Status": "Service restored",

"Messages": [

{

"PublishedTime": "2015-04-01T22:34:28.76Z",

"MessageText": "Current Status: Engineers are investigating an issue in which some customers may be experiencing problems accessing or using Exchange Online services or features. This event is actively being investigated. More information will be provided shortly."

},

{

"PublishedTime": "2015-04-03T18:45:32.56Z",

"MessageText": "Current Status: Engineers are implementing a fix within the affected infrastructure to remediate Exchange Online archive access issues. \n\nUser Experience: Affected users are unable to access online archives when using Outlook Web App (OWA). As a workaround, users may be able to access online archives via the Outlook client.\n\nCustomer Impact: Customer impact appears to be limited at this time. This issue only affects hybrid customers.\n\nPreliminary Root Cause: As part of our ongoing work, an updated certificate was deployed to the infrastructure; however, a caching issue has caused the infrastructure to use an expired certificate which is causing archive access issues. \n\nNext Update by: Monday, April 6, 2015, at 9:00 PM UTC\n"

},

{

"PublishedTime": "2015-04-06T21:17:34.007Z",

"MessageText": "Current Status: Deployment of the fix is almost complete. Engineers are monitoring service health to ensure the issue has been remediated. \n\nUser Experience: Affected users are unable to access online archives when using Outlook Web App (OWA). As a workaround, users may be able to access online archives via the Outlook client. \n\nCustomer Impact: Customer impact appears to be limited at this time. This issue only affects hybrid customers.\n\nPreliminary Root Cause: As part of our ongoing work, an updated certificate was deployed to the infrastructure; however, a caching issue has caused the infrastructure to use an expired certificate which is causing archive access issues. \n\nNext Update by: Tuesday, April 7, 2015, at 10:00 PM UTC "

},

{

"PublishedTime": "2015-04-08T21:54:49.06Z",

"MessageText": "Final Status: Engineers have implemented a fix which remediated end-user impact. \r\n\r\nUser Experience: Affected users were unable to access online archives when using Outlook Web App (OWA).\r\n\r\nCustomer Impact: Customer impact appears to have been limited. This issue only affected hybrid customers.\r\n\r\nIncident Start Time: Monday, March 30, 2015, at 9:28 AM UTC\r\n\r\nIncident End Time: Tuesday, April 7, 2015, at 8:00 PM UTC\r\n\r\nPreliminary Root Cause: As part of our ongoing work, an updated certificate was deployed to the infrastructure; however, a caching issue has caused the infrastructure to use an expired certificate which is causing archive access issues. \r\n\r\nNext Steps: The following is a list of known action item(s) associated with this incident. As part of the Office 365 problem management process, additional engineering actions may be identified to improve the overall service.\r\n- Action: Review the monitoring infrastructure for improvements as this event was reported by customers before an alert prompted a high priority investigation. \r\n\r\nA post-incident report will be available on the Service Health Dashboard within five business days."

}

],

"LastUpdatedTime": "2015-04-08T21:54:49.55Z",

"Workload": "Exchange Online",

"WorkloadDisplayName": "Exchange",

"Feature": "Access",

"FeatureDisplayName": "E-Mail and calendar access"

},

{

"Id": "EX20789",

"Name": "EX20789",

"Title": null,

"StartTime": "2015-04-06T20:00:00Z",

"EndTime": "2015-04-07T23:00:00Z",

"Status": "Service restored",

"Messages": [

{

"PublishedTime": "2015-04-07T23:26:44.643Z",

"MessageText": "Final Status: Engineers have validated that the deployed fix has resolved the issue and that service is restored.\r\n\r\nUser Experience: Affected users were unable to send or receive email while using Exchange Web Services (EWS) on their mobile devices.\r\n\r\nCustomer Impact: Customer impact appeared to be limited during this event. This issue was only affecting customers that use third-party Mobile Device Management software from Good Technology. As a workaround to provide immediate relief from impact, engineers implemented a configuration change for customers who reported this issue to Microsoft Support.\r\n\r\nIncident Start Time: Wednesday, April 1, 2015, at 2:00 PM UTC\r\n\r\nIncident End Time: Tuesday, April 7, 2015, at 10:00 PM UTC\r\n\r\nPreliminary Root Cause: As part of our ongoing efforts to improve service resiliency, an update was deployed to the infrastructure that facilitates connections from multiple Exchange Online protocols to mailbox databases. The update, however, contained a code issue that caused connectivity issues in some scenarios. \r\n\r\nNext Steps: The following is a list of known action item(s) associated with this incident. As part of the Office 365 problem management process, additional engineering actions may be identified to improve the overall service.\r\n- Action: Review the infrastructure update process to prevent reoccurrences of this scenario.\r\n\r\nPlease consider this service notification the final update on the event."

}

],

"LastUpdatedTime": "2015-04-07T23:26:45.08Z",

"Workload": "Exchange Online",

"WorkloadDisplayName": "Exchange",

"Feature": "Access",

"FeatureDisplayName": "E-Mail and calendar access"

}

]

}

错误

如果遇到错误,服务会使用标准 HTTP 错误代码语法,向调用方报告错误响应代码。 根据 OData V4 规范,失败调用的正文中包含其他信息(作为一个 JSON 对象)。 下面的示例展示了完整的 JSON 错误正文:

{

"error":{

"code":"AF5000. An internal server error occurred.",

"message": "Retry the request."

}

}

在服务器端调用微软office接口,Office 365 服务通信 API 参考相关推荐

  1. C++ —— 调用微软语音接口(SAPI),实现文字转语音播放

    SAPI介绍      SAPI(The Microsoft Speech API) ---- 微软语音接口      SAPI中的语音技术包括两部分内容:语音识别.语音合成.均需语音引擎的支持.   ...

  2. python企业微信群聊_python调用企业微信接口发送群聊消息代码参考

    # Author: sea 2019 import requests import json import time class WebchatUtil: corpid = '必须填写你自己申请的' ...

  3. postman调用rpc服务器接口_RPC 原理

    RPC 是什么 (what) Remote Procedure Call,缩写为 RPC 远程过程调用 客户端和服务器端约定好一个接口 (eg: SOA api 里边的接口) 客户端调用接口的时候,去 ...

  4. 【疑难解决】RTSP协议视频流媒体平台EasyNVR调用云台控制接口返回400报错的问题处理

    网络摄像头RTSP协议视频直播平台是TSINGSEE青犀视频全线产品中最先支持ONVIF协议的平台,可以通过ONVIF进行云台控制. 在用户使用EasyNVR调用云台控制的接口时,发现会返回400的报 ...

  5. 全局中断_【安全圈】微软更新造成Office 365等多个在线服务中断!

    9月29日,微软Office官方确认,某些微软服务(Outlook,Office 365和Microsoft Teams)当前出现网络故障,微软表示"用户可能无法访问多个Microsoft ...

  6. 通过微软官方接口预览office文件的js

    通过微软官方接口预览office文件的js //预览office function office(url){//文件名filename = url;var uri = url.replace(&quo ...

  7. 打工人抛弃办公室,微软丢掉「Office」

    陪伴一代人长大的 Microsoft Office,正在成为历史. 今年 10 月,微软对外宣布,将对 Office 进行一次「品牌重塑」,新的品牌被命名为 Microsoft 365,仍囊括 Wor ...

  8. 使用微软提供的Office Online实现Office文档的在线查看,编辑等功能

    使用微软提供的Office Online平台只需要一个网址即可在线查看Xls,doc,PPT等文档 http://view.officeapps.live.com/op/view.aspx?src=要 ...

  9. 使用http连接到microsoft exchange_如何使用 PowerShell 连接 Office 365 服务

    适用于以下产品或服务:    Office 365 管理员的日常管理中.使用 PowerShell 是除了Office365 管理中心外,最为高效的工具.这里将会介绍 PowerShell 连接到 O ...

最新文章

  1. hdu1671 字典树记录前缀出现次数
  2. linux go语言环境配置文件,linux下安装配置go语言环境
  3. 基于单片机步进电机ppt答辩_基于单片机的步进电机式汽车仪表的设计(含电路原理图,程序)...
  4. 机器学习实践七----异常检测和推荐系统
  5. recovery模式下支持ADB连接和串口操作
  6. ssm read time out的原因_自检轮胎暗漏原因_什么是自检轮胎暗漏原因
  7. 批处理等待上一条完成再执行下面的_分布式批处理实现方案
  8. 世界大学生超算竞赛正式启动,再次引发全球关注
  9. zen cart 操作
  10. python一维数组聚类
  11. pyspark报错问题 Exception in thread main java.lang.UnsupportedClassVersionError 成功解决
  12. [ github ] 10道题串起 Pandas 常用知识点
  13. Tip | 使用GitHubDesktop提交 本地existing项目
  14. 拉卡拉考拉超收,关于它的全部信息!
  15. between and 用法
  16. keep-alive实现原理
  17. Win7系统组策略怎么打开 打开组策略的几种方法
  18. 舌尖上的AI:人工智能技术正在被“端上”餐桌
  19. python工程监理_1.工程监理招标属于()
  20. 基于matlab数字交换网络的仿真,基于MATLAB数字交换网络的仿真

热门文章

  1. ethos-专用系统 2019.08.18升级公告!
  2. 电脑将图片转为excel表格的几种常用方法
  3. Angular5 避免重复请求
  4. SMATE: Semi-Supervised Spatio-Temporal Representation Learning on Multivariate Time Series
  5. 408考研计算机之计算机组成与设计——计算机层次系统概述1
  6. 80MHz~100MHz频谱分析仪设计
  7. 上海电信SDN千兆 烽火通信光猫HG7143D
  8. 企业微信本地开发小程序。
  9. 视频平台完善“青少年模式”,应先“从无到有”再“从有到优”
  10. 系统集成项目管理工程师考点重点:国家信息化体系要素