Office Development
Image courtesy: internet source

In this article, I will introduce you to the MS Graph API which is a powerful way to interact with Office 365 data.

Here are the objectives of this article:

Let’s start with MS Graph API.

What is MS Graph API?

The official MS documentation defines MS Graph API as:

“You can use the Microsoft Graph API to interact with the data of millions of users in the Microsoft cloud. Use Microsoft Graph to build apps for organizations and consumers that connect to a wealth of resources, relationships, and intelligence, all through a single endpoint: https://graph.microsoft.com.”

In a nutshell, MS Graph API gives you a single REST API endpoint which you can call to interact with “almost anything” in Office 365.

How did it come into the picture?

Prior to MS Graph API, Microsoft had different APIs for its different Office 365 and cloud products. Outlook, OneDrive, OneNote, Yammer all had their different APIs to interact with them.

Consider the following steps involved while dealing with different Office 365 APIs in an application:

It made a developer’s life difficult if one had to connect to many different APIs in an application.

As a solution, Microsoft launched the MS Graph API which is also called “One endpoint to rule them all”.

Why should you learn MS Graph API?

Office 365 is undoubtedly the most widely-used office produce worldwide. Millions of people are using the commercial versions of Office 365 suite or one or another of its products like Outlook, OneNote, etc.

On average, a user in any office will use 2-3 hours working on different Office suite products like Outlook, Excel, Project, etc. Millions of new emails, events, etc. are generated in Outlook and millions of files are stored on OneDrive.

If you want to access all this information stored in Office 365 or on Azure, then you need MS Graph API.

Advantages

Features

I have written some articles on using optional ODATA query parameters with MS Graph API which can be found here:

Limitations

The most visible one is some of its features are still in beta, but MS Graph team keeps launching new features live regularly.

For a list of all MS Graph API known issues, refer here.

MS Graph API Explorer

MS Graph API Explorer

MS Graph API Explorer is a great tool to get started with MS Graph API and learn first-hand how it works. Graph Explorer is a developer sandbox where you can fire actual Graph API call and see its result.

You can access MS Graph API Explorer here.

I have written some articles on how to use MS Graph Explorer which can be found here:

Microsoft Graph SDK

The MS Graph team has done some great work in launching SDKs for different platforms which makes development with MS Graph API easy.

You don’t have to code everything from scratch, ready-made codes are available in SDK.

The following SDKs are available:

MS Graph API Explorer

If you are a Java developer, then recently Microsoft has launched Java SDK for MS Graph API in preview.

If you want to add MS Graph SDK in any of your C# applications, then open Visual Studio and simply search for “Microsoft Graph” in NuGet package manager to get started.

MS Graph API Explorer

That’s it for an introduction to MS Graph API in this article. Wait for my next article where I will show how you can start programming in MS Graph API.

Until then the following links will be useful to get started with MS Graph API: