Ultimate Tutorial about Microsoft Graph APIs

Ultimate Tutorial about Microsoft Graph APIs

This tutorial demonstrates some of the features of Microsoft's Graph API and outlines what you can expect when you use it.

What is Microsoft Graph?

In this article, we’ll talk about Microsoft Graph APIs and will show you a quick preview of the essential features. This technology is growing too fast so some existing features may not be longer available at the time of reading and surely new features will be added to it after the time of writing.

Microsoft Graph API – formerly known as Office 365 unified API - is the new service-oriented architecture owned by Microsoft to allow developers to access a vast amount of data from the Microsoft cloud platforms. Microsoft web API is essentially designed to collaborate with Office 365 and some other services hosted on the MS Azure cloud platform.

Microsoft API and Service Architecture

The Microsoft Graph APIs expose RESTful services. This makes it very flexible because REST is compatible with almost any modern platform programming language. The exchange format is essentially in JSON and it can be encapsulated into the HTTPS transport security. The central point of Microsoft Graph is the concept of User, the authentication and authorization follow the OAuth2.0 mechanism making the user and role management to be standard for developers.

Microsoft Graph API Revision

At the time of writing, Microsoft Graph API v1.0 is a stable revision that fulfills all production qualifications. A beta revision is also available in parallel for the latest releases, however, its main purpose is for testing new functionalities by the early adopter, and in any way, it is not recommended to be deployed into the production environment.

Get Started with Microsoft Graph API

As stated earlier Microsoft Graph API uses RESTful services. You need to have first a basic background about how REST is working. The next is to have a good grasp on how to build queries using REST sauce. This part is pretty the same thing as doing ADO.NET services queries. And the last but not the least one is to know the REST resource URL. For example, if you want to retrieve all the contacts for a given user, you should be aware of the exact resource URL matching your expectation. You may have noticed that those requirements remain valid regardless of any programming languages. After the server returns back to your apps, you need to write some codes in your favorite languages to parse JSON format in order to extract entities you may need to use. This is how it works at a basic level.

Microsoft, fortunately, provides language-specific SDK to communicate with Microsoft Graph in the test of object-oriented programming. If you're going on that way, the SDK is managing automatically the whole process. Thus you're not going to deal with basic HTTP requests; instead, you're dealing directly with the platform object representation. The following technologies have a good integration within Microsoft Graph: ASP .NET MVC, Universal Windows platform, Php, Angular, Node.js, Ruby, and for mobile platforms Android, iOS Swift, iOS Objective-C, and Xamarin. We will show you a code snippet later on.

Easy Testing

Microsoft provides a very helpful online utility name Graph Explorer to allow devs to test their REST queries in the easiest way. You can experiment with your own data on the cloud. The principle is done in 2 steps: sign in with your Microsoft Account, create your app credentials and secrets then run any queries you want in the URL query bar. It is available at https://developer.microsoft.com/en-us/graph/graph-explorer

Before Accessing the Services – Setting up Account Credentials

From your Microsoft account (for example outlook.com ) you need to get an appID and secret from the Microsoft Application Registration portal. The appID and secret are used to identify your profile each time a request is made by the Microsoft Graph API. If you are familiar with Facebook/Twitter/Linkedin/Google plus application development the same mechanism is used here to access remote resources. If you omit this step or give a wrong AppID/secret the service will throw a notification with the corresponding error message.

What Can a Developer Do with Microsoft Graph API?

Microsoft Graph API allows developers to build rich apps using a variety of data sources. Under the hood, it is more than a simple tool to access cloud storage. Microsoft Graph indeed comes with high-level interfaces and endpoints to perform business intelligence data analysis. This feature is very helpful if you are rowing in machine learning analysis or in a need of high-quality level of reports and dashboard plots. It comes with a bunch of insights algorithms for mining predictions and forecast purposes.

We enumerate below the essential components of Microsoft Graph that can be accessed using the API:

  • Mail services (Outlook account) and Exchange server: If you plan to send emails or more generally communicate with the mail server. As a developer you can drive email service flows from your apps without any knowledge of how to configure Exchange server. You can even send an email on behalf of another user.
  • Calendar for managing schedules and events. Your app can now automatically manage your incoming events by simply calling the calendar and events API. You can add, delete, or modify your schedule dashboard by your favorite programming language.
  • Documents Management System for documents flows, track and share Office365 documents like wordbooks, Excel sheets, etc. Microsoft Graph API gives your app the advantage of editing an Excel file referenced on the cloud without having to open it in an Excel program. You can locate an Excel worksheet cell or you can add a chart image directly from your code.
  • Tasks and workflows between stakeholders by Office 365 Planner API, you define a task first, then add users going to participate in the task and finally run the workflow. Depending on the type of workflow, a user may approve his task before it continues to the next users or rejects it to send it back for review to the previous user. The API is also able to show the task progress by giving the percentage of the completed task.
  • File and media transfers through Microsoft OneDrive storage or Sharepoint document library, you can exchange photos, videos, streams, and many other formats. Ready-made API already exists to handle all of them. You can even call the Apis outside your current domain using the Cors capabilities. This particularity is the way to share everything everywhere (of course you always have the full control on what you want to share and who had access to them)

microsoft tutorial api rest developers graph programmers api access

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

What is REST API? An Overview | Liquid Web

What is REST? The REST acronym is defined as a “REpresentational State Transfer” and is designed to take advantage of existing HTTP protocols when used

An API-First Approach For Designing Restful APIs | Hacker Noon

I’ve been working with Restful APIs for some time now and one thing that I love to do is to talk about APIs.

Consume Web API Post method in ASP NET MVC | Calling Web API | Rest API Bangla Tutorial

LIKE | COMMENT | SHARE | SUBSCRIBE In this tutorial, I will discussed about how to consume Web API Get method and display records in the ASP.NET View. Here, ...

Consume Web API Get method in ASP NET MVC | Calling Web API | Rest API Bangla Tutorial

LIKE | COMMENT | SHARE | SUBSCRIBE In this tutorial, I will discussed about How to Consume Web API Get method in ASP NET MVC. Blog : http://aspdotnetexplorer...

Consume Web API Put method in ASP NET MVC | Calling Web API | Rest API Bangla Tutorial

LIKE | COMMENT | SHARE | SUBSCRIBE In this tutorial, we learned how to consume Web API Get and Post methods in the ASP.NET View. Here, we will see how to con...