Nowadays, there is a lot happening around Microsoft Graph; a lot of changes have been made and a lot of new changes are arriving soon, such as - Graph APIs for Microsoft Teams, use of MS Graph APIs in SPFX component, unified access to services in M365 suite, and more. So, I thought to write this series of articles for exploring the Microsoft Graph concepts with the help of use cases and examples.
Note - If you really want to go in depth of Microsoft Graph, please go through all the articles in this series, put your comments, and ask questions. For Office 365/SharePoint Online developers, Microsoft Graph is the future.
Microsoft Graph
- Microsoft Graph unifies the access of the services in M365 Suite.
- M365 is defined by Microsoft as “A complete, intelligent solution, including Office 365, Windows 10, and Enterprise Mobility + Security, that empowers everyone to be creative and work together, securely.”
- We can fetch data using single public endpoint - https://graph.microsoft.com either using simple REST calls or with an SDK available on just about any platform.
- Microsoft Graph provides REST APIs and SDKs for the following services to fetch the data.
- Office 365 Services accessible through Microsoft Graph (till Nov 2018) – SharePoint, OneDrive, Outlook / Exchange, Microsoft Teams, OneNote, Planner, Excel, Azure AD
- Azure AD
- Education
- Enterprise Mobility and Security Services: Identity Manager, Intune, Advanced Threat Analytics, and Advanced Threat Protection.
- Windows 10 Services: activities and devices
Figure 1: Office 365 - Microsoft Graph - Accessing different Microsoft services
Before Microsoft Graph, we faced a bunch of challenges while fetching the data across these different Microsoft Services.
- Each service had their own REST points
- Discovering these different endpoints
- We need to authenticate each endpoint separately
- We need to manage different permissions
- We need to manage different data formats returned through respective endpoints
- And so on…
Why Office 365 / SharePoint Online developers should understand Microsoft Graph.
- Covers APIs across multiple services - Office 365, Azure AD, Enterprise Mobility and Security, Windows 10
- A single endpoint for all the above Microsoft Services
- Single access token for authentication to multiple services
- Managing permissions with common permission model
- Microsoft Graph supports multiple languages and platforms either through REST APIs or SDK available such as,
- Android
- Angular
- NET MVC
- iOS
- JavaScript
- PHP
- Python
- Ruby
- UWP
- Xamrin
Figure 2: Office 365 - Microsoft Graph - Various languages and platform support
Microsoft Graph Developer stack
Figure 3: Office 365 - Microsoft Graph - Developer Stack
- From the above figure at the bottom, there are various data sources available
- Using Microsoft Graph APIs, we can fetch data from all these data sources using single endpoint call to https://graph.microsoft.com
- In order to access Microsoft Graph API, we need OAuth 2.0 access token – we will cover this in detail in coming articles.
References
- M365
- Microsoft Graph
- Get started with Microsoft Graph
- Major services and features in Microsoft Graph.
- Graph Explorer
- Microsoft Graph GitHub