So I recently discussed the possibility of talking about Microsoft Graph API at the M365 User Group in Leeds. It’s always good to introduce new content at these events and get people engaged in technologies that they’ve not had the opportunity to look at before.
Microsoft Graph API is a technology that allows applications services to consume data in Microsoft 365. It is primarily focused at developers who can build applications to take advantage of the API.
Microsoft defines 4 application patterns such as Web Apps, Bots, Device and Native Apps and Background Processes that can take advantage of the Graph API and interact with data in Microsoft 365
These 4 services can make HTTP requests to Microsoft 365 services under one universal API called https://graph.microsoft.com.
It’s worth me highlighting that the Graph API should not be confused with PowerShell. This are two different tools with different capabilities and purposes. Graph API is used by applications that want to interact with data in Microsoft 365, perhaps you have a business requirement to develop an in house application that requires access to the data.
PowerShell is a CLI\Toolmaking\Scripting tool that can be used to help automate tasks and business processes, to assist with repetitive tasks and administration of Microsoft platforms.
What both tools (to a degree) have in common is that they can both be used to interact with data M365 but the mechanics are different.
For example you could run a simple GET request in Graph to get a list of users in your organization (https://graph.microsoft.com/v1.0/users). In PowerShell you would use a cmdlet like Get-AzureADUser to return a list of users from the directory.
Where to Start?
Graph is well documented and there is not shortage of great resources out there. I’ll list the resources I found and which ones will be the most valuable to you to to get started.
Introduction to Microsoft Graph API
Microsoft Graph Change Log
The 30 days of Microsoft Graph is probably the best place to start. It’s a very simple yet very effective way of exposing yourself to Microsoft Graph functionality and some very low level development that acts as a solid proof of concept.
Each part of the blog gives a training objective and some practical skills to apply.
One of things I would recommend reading and getting to grips with is how the Microsoft Identity Platform is leveraged and how authorization code flows work. These topics are covered in the series and will discuss OAuth 2.0 accompanied with practical examples that will help enhance your understanding of how applications are granted authorization tokens that can be used with the Graph API.
Here are a couple of examples of the authorization flows
These resources should help get you get up and working with the Microsoft Graph API quickly and introduce you to some new concepts and tools that will aid in your development.