In this tutorial, we will learn what is Microsoft Graph API? Also we will check out a few features and improvements in Microsoft graph explorer.
What is Microsoft Graph API
Microsoft graph is one of the excellent features in the Microsoft cloud environment. It provides many features to use in our application. We can simply call as Graph API and it is a Restful web API that we can use to communicate with Microsoft cloud other services.
Microsoft Graph provides a unified programmability model that you can use to access the tremendous amount of data in Office 365, Windows 10, and Enterprise Mobility + Security, with the entire Microsoft 365 platform.
We can get all APIS from Office 365 in a single endpoint called https://graph.microsoft.com.
There are common components that are included in this API. That we have to provide while calling this.
{HTTP method} https://graph.microsoft.com/{version}/{resource}?{query-parameters}
- HTTP
- Version
- Resources
- Query-Parameter
And after execution, it will give the response with include the below component.
- Status code
- Response message
Microsoft Graph API can able to access the data from below other Office 365 services.
- Microsoft Team
- Microsoft Azure Services
- OneDrive
- OneNote
- Excel online
- Outlook online
- Planner
- SharePoint
- Microsoft Security
- Microsoft Notification
- Batching etc.
Read How to Authorize users to access GRAPH APIs with OAuth 2.0
In Real time Scenario where we are using this service ?
- Suppose My client needs to show his outlook on new emails or meetings inside the SharePoint page. So here we can easily use Graph API to call outlook email and show in SharePoint Online.
- Sometimes a client needs to see all users and groups inside the SharePoint. So here we can use this service to get all users and groups.
Below are the collection of Graph API which we are using in our application in daily basis.
Service Name | URL |
Get My profile | https://graph.microsoft.com/v1.0/me/ |
Get Email | https://graph.microsoft.com/v1.0/me/messages |
Create User (POST) Get Users(GET) | https://graph.microsoft.com/v1.0/users |
Get all Planner Task | https://graph.microsoft.com/beta/me/planner/tasks |
Get All item in My drive | https://graph.microsoft.com/v1.0/me/drive/root/children |
Get Members in Team | https://graph.microsoft.com/v1.0/groups/{group-id-for-teams}/members |
Get my Calendar | https://graph.microsoft.com/v1.0/me/calendars |
Get User Recent activity | https://graph.microsoft.com/v1.0/me/activities/recent |
Send Message in team | https://graph.microsoft.com/beta/teams/{group-id-for-teams}/channels/{channel-id}/messages/{message-id} |
We can also get more APIs in Microsoft explorer. Click on the below link to get all APIS.
These are the features that we can achieve when we use Graph API in SharePoint.
You may like following tutorials:
You can refer below Microsoft link to get more information about Microsoft Graph API and what are the new features which have added and removed from graph API.
Reference:
- https://docs.microsoft.com/en-us/graph/use-the-api
- https://docs.microsoft.com/en-us/graph/overview
- https://developer.microsoft.com/en-us/graph/docs/overview/overview
Microsoft Graph Explorer Features and Improvements
Now we will see a few Microsoft graph explorer new improvements.
Microsoft recently releases a new version of graph explorer, which is available on the below link:
This is developed using the React/Redux framework and it is very easy to use for the developers.
Old Microsoft graph explorer
This is how the old Microsoft graph explorer looks like:
New Microsoft graph explorer
The new Microsoft graph explorer looks like below:
If we look into the above images, there many changes has happens here.
Below are a few Microsoft Graph Explorer new improvements and new features.
1: Modify Permission
In the new graph explorer, the Permission tab is presently closed to Request Header at the top so that we can easily provide the permission when it required.
2: Access Token
Microsoft has a newly added access token tab to secure our application. You can copy the access token to use in our application. It is added to this explorer.
3: Adaptive Cards
Here you can see your result in a well format so that developer can understand it very easily.
4: Code Snippets
Code Snippets is one of the good features which is added in the graph explorer. Here we can easily get all the API call code in different programming languages: C#, Java, JavaScript, and Objective C.
5: Expand Response
Here you can expand the explorer to see the output in good format and separate window.
6: Sample Query
Now you will get all related sample queries in an order with a group by items so that you can easily search the query based on the topic.
I hope you enjoy this new version of Graph Explorer and we look forward to hearing your feedback.
In this tutorial, we learned what is Microsoft Graph API and a few new features and improvements in Microsoft Graph Explorer.
Related SharePoint tutorials:
- crud operations using rest api SharePoint Online
- How to Create and delete a file using Rest API in SharePoint Online
- Create Highcharts in SharePoint using Rest API
- Create custom announcement web part using Rest API in SharePoint
- Create SharePoint Quote of the day web part using Rest API and Bootstrap
- Access Rest API using Postman in SharePoint Online
- How to update person or group column in SharePoint rest api
- SharePoint Rest API Select, Filter, Sort and Paging Example
Rajkiran is currently working as a SharePoint Consultant in India . Rajkiran having 7+ years of experience in Microsoft Technologies such as SharePoint 2019/2016/2013/2010, MOSS 2007,WSS 3.0, Migration, Asp.Net, C#.Net, Sql Server, Ajax, jQuery etc.He is C#Corner MVP (2 Times).