Working with Graph Explorer
Graph Explorer is a developer tool that lets you conveniently make Microsoft Graph REST API requests and view corresponding responses. This article describes how to use some of the important features in Graph Explorer.
Consent to permissions
The user or administrator must grant Graph Explorer the correct permissions via a consent process to access data in Microsoft Graph. Consent to permissions in Graph Explorer either via the Modify permissions tab or the Select permissions option in the settings gear next to your profile when you’re signed in. The Modify permissions tab lists all permissions you need to run the query in the address bar.
To consent to permissions:
- Select a sample query and run it.
- Select the Modify permissions tab.
- See the list of permissions required to run the query.
- Select the consent button next to the permission you want to consent to.
The Modify permissions feature is currently in preview, and some queries might be missing permissions. If permissions are missing for a query, the Select permissions option in the settings gear next to your profile contains the list of all available permissions:
- Go the settings gear and click the Select permissions option. This option contains the list of all available permissions.
- From the list of all the permissions, consent to the ones you want.
Get an access or authentication token
Graph Explorer includes an Access token tab that shows your access token when you are signed in. On the Access token tab, you can copy the token if you need to use it in your favorite REST client application.
Copy code snippets
UI component integration
Graph Explorer includes several features to make implementing UI easier. Reuse these components in your apps too.
Microsoft Graph Toolkit integration
The Microsoft Graph Toolkit is a collection of reusable, framework-agnostic web components and helpers for accessing and working with Microsoft Graph. The components are fully functional, with built in providers that authenticate with and fetch data from Microsoft Graph.
Graph Explorer provides sample REST API queries that correspond to Microsoft Graph Toolkit components. A blue dot on the Toolkit component tab indicates that the Toolkit provides a component for the currently specified REST API query in Graph Explorer. You can conveniently copy the code for the component to your app.
The following table lists the sample queries that currently include a Toolkit component.
|Graph Explorer sample query||Toolkit sample iFrame URL|
|GET my profile||https://mgt.dev/iframe.html?id=components-mgt-person-card—person-card-hover|
|GET people I work with||https://mgt.dev/iframe.html?id=components-mgt-people—people|
|GET all my planner tasks||https://mgt.dev/iframe.html?id=components-mgt-tasks—tasks|
|GET my events for the next week||https://mgt.dev/iframe.html?id=components-mgt-agenda—get-events-for-next-week|
|GET my photo||https://mgt.dev/iframe.html?id=components-mgt-person—person-photo-only|
Adaptive cards integration
Adaptive cards are platform-agnostic snippets of UI, authored in JSON, that apps and services can openly exchange. When you run a query and an adaptive card is available, a blue dot appears on the Adaptive cards tab.
Customize the theme in Graph Explorer
Choose the theme for Graph Explorer by selecting the Change theme option under the settings gear. Theme options are Light, Dark, and High contrast.
Storing and sharing queries
Queries run in Graph Explorer are saved for 30 days in the History tab. On the History tab, you can:
- Export all history items in .har format.
- Delete all history items.
- View this history item.
- Run this query.
- Export this history item in .har format.
- Delete this history item.
To share queries that you run, click the share query button in the response pane and click copy. This copies a link to share and allow others to see your query and the results.
Graph Explorer UI features
Collapse and expand the sidebar component in Graph Explorer when you want to widen the request and response area. To collapse the sidebar component, select the hamburger icon on the top left of the sidebar.
Expand and collapse the response preview by selecting the expand arrow in the response preview window.
Conveniently access the Microsoft 365 Developer Program site from the Graph Explorer UI to get a free sandbox with sample data to experiment with. Under the setting gear, select Get a sandbox with sample data.