OData Service for namespace microsoft.graph logo

OData Service for namespace microsoft.graph

OData Service for namespace microsoft.graph

Microsoft Graph 统一访问 Microsoft 365 数据(邮件、日历、Teams、OneDrive、用户目录),是企业 Microsoft 集成的入口。

访问站点 ↗健康巡检 9 小时前
适合什么时候用

一个 endpoint 覆盖 M365 全产品线

先注意什么

权限申请需要租户管理员同意,部分 scope 需 admin consent

第一步先查

在 portal.azure.com 注册一个 Azure AD app,配权限(delegated 或 application)。OAuth 流程拿 access_token,调 https://graph.microsoft.com/v1.0/... 各端点。常用 SDK:@microsoft/microsoft-graph-client (JS)、Microsoft.Graph (C#)、msgraph-sdk (Python)。

认证
oauth
CORS
不支持
HTTPS
注册
需要
延迟
109 ms
协议
REST
计费
free

可用率 · 30 天窗口

巡检: 1可用率: 100%平均延迟: 109ms
01

关于这个 API

Microsoft Graph 把分散在 Outlook、Teams、SharePoint、OneDrive、Azure AD、Excel Online、To Do 等产品的 API 统一到一个 REST 端点。对企业开发者来说意味着不必为每个 M365 产品单独写集成——一套 OAuth 凭证、一套 SDK 就能跨产品做协同。

权限模型分两类。Delegated 权限是应用代表登录用户操作,scope 受用户本身权限限制(如读自己的邮件);Application 权限是应用自身的身份,需要租户管理员同意,能跨用户操作(适合后台任务)。两套都基于 OAuth 2.0,但 consent 流程和后续 token 内涵不同。设计时要明确选哪种——选错往往后期返工。

速率限制是分布式的:每个 service(Outlook、Teams、SharePoint 等)独立计费,没有统一的总配额。被限时会返回 429 + Retry-After 头,应用层需做指数退避。Change Notifications(webhook)让长链接不必反复轮询,但需公网可访问的 HTTPS 端点。

02

你可以做什么

  • 1为 Microsoft 365 用户搭建邮件 / 日历 / 任务集成
  • 2把外部系统数据写入 Teams 频道
  • 3从 OneDrive / SharePoint 读取文件做处理
  • 4基于 Azure AD 目录做 SSO 与用户同步
  • 5为内部工具读写 Excel Online
03

优劣对比

优点

  • 一个 endpoint 覆盖 M365 全产品线
  • 细粒度 application + delegated 双权限模型
  • webhook 与 Change Notifications 推送变更
  • SDK 在 JS/C#/Python 等主流语言都有官方维护

注意事项

  • 权限申请需要租户管理员同意,部分 scope 需 admin consent
  • 速率限制按 resource 分散,调用前难预测
  • 某些 beta endpoint 不保证 SLA 与稳定性
04

示例请求

通用模板 — 实际 endpoint 请查阅文档替换 <endpoint>。
curl https://microsoft.com/<endpoint> \
  -H "Authorization: Bearer $ACCESS_TOKEN"
05

快速开始

在 portal.azure.com 注册一个 Azure AD app,配权限(delegated 或 application)。OAuth 流程拿 access_token,调 https://graph.microsoft.com/v1.0/... 各端点。常用 SDK:@microsoft/microsoft-graph-client (JS)、Microsoft.Graph (C#)、msgraph-sdk (Python)。

06

常见问题

Graph API 收费吗?+

免费使用,但你必须有有效的 Microsoft 365 / Azure AD 租户。某些功能(如某些 Teams 工作流)需付费 plan。

Delegated 和 Application 权限选哪个?+

需要某用户实时上下文(如读自己邮件)用 Delegated;后台任务、多用户操作用 Application。

admin consent 是什么?+

某些 scope 影响范围超出单用户(如读全租户用户列表),租户管理员必须明确同意才生效。

v1.0 与 beta 端点的区别?+

v1.0 是稳定 GA,有 SLA 与兼容性承诺;beta 提供更早能力但不保证稳定,生产慎用。

07

技术细节

CORS: NoHTTPS: Yes注册: Yes开源: No
认证方式
oauth
计费
free
协议
REST
SDK
javascript, typescript, python, csharp, java, go
响应时间
109 ms
上次巡检
2026/5/12 07:37:52
08

接口端点

从 OpenAPI spec 自动解析。显示 12 / 11412 个未弃用端点。

GET
/adminadmin.admin

Get admin

$select:query$expand:query
PATCH
/adminadmin.admin

Update admin

DELETE
/admin/serviceAnnouncementadmin.serviceAnnouncement

Delete navigation property serviceAnnouncement for admin

If-Match:header
GET
/admin/serviceAnnouncementadmin.serviceAnnouncement

Get serviceAnnouncement from admin

$select:query$expand:query
PATCH
/admin/serviceAnnouncementadmin.serviceAnnouncement

Update the navigation property serviceAnnouncement in admin

GET
/admin/serviceAnnouncement/healthOverviewsadmin.serviceAnnouncement

List healthOverviews

$orderby:query$select:query$expand:query
POST
/admin/serviceAnnouncement/healthOverviewsadmin.serviceAnnouncement

Create new navigation property to healthOverviews for admin

DELETE
/admin/serviceAnnouncement/healthOverviews/{serviceHealth-id}admin.serviceAnnouncement

Delete navigation property healthOverviews for admin

serviceHealth-id:path*If-Match:header
GET
/admin/serviceAnnouncement/healthOverviews/{serviceHealth-id}admin.serviceAnnouncement

Get healthOverviews from admin

serviceHealth-id:path*$select:query$expand:query
PATCH
/admin/serviceAnnouncement/healthOverviews/{serviceHealth-id}admin.serviceAnnouncement

Update the navigation property healthOverviews in admin

serviceHealth-id:path*
GET
/admin/serviceAnnouncement/healthOverviews/{serviceHealth-id}/issuesadmin.serviceAnnouncement

Get issues from admin

serviceHealth-id:path*$orderby:query$select:query$expand:query
POST
/admin/serviceAnnouncement/healthOverviews/{serviceHealth-id}/issuesadmin.serviceAnnouncement

Create new navigation property to issues for admin

serviceHealth-id:path*

另有 11400 个端点未显示,详见 OpenAPI spec。

09

标签

10

更多来自 Microsoft 的 API

11

可以替代的选择

不同公司、解决相似问题的备选。按分类、认证、计费档位与标签重合度匹配。