Work 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.

For an overview, see Use Graph Explorer to try Microsoft Graph APIs.

The user or administrator must grant Graph Explorer the correct permissions by using a consent process to access data in Microsoft Graph. You can consent to permissions in Graph Explorer by choosing either 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 the permissions that you need to run the query in the address bar.

To consent to permissions:

  1. Select a sample query and run it.
  2. Select the Modify permissions tab.
  3. See the list of permissions required to run the query.
  4. Select the Consent button next to the permission that you want to consent to.

Screenshot of Graph Explorer with the steps to consent to permissions highlighted

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:

  1. Go the settings gear and choose the Select permissions option. This option contains the list of all available permissions.
  2. From the list of all the permissions, consent to the ones you want.

Screenshot of Graph Explorer with the Select permissions option highlighted

Get an access or authentication token

Graph Explorer includes an Access token tab that shows your access token when you're signed in. On the Access token tab, you can copy the token if you need to use it in your favorite REST client application.

Screenshot of the Access token tab in Graph Explorer with the Copy button highlighted

Copy code snippets

For each REST API query that you select or enter in Graph Explorer, you can find how to call that API in each of the four languages showcased under the Code snippets tab: C#, Java, JavaScript, and Objective-C.

Screenshot of Graph Explorer with the code snippets tab highlighted

Integrate UI components

Graph Explorer includes several features to make implementing the 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—person-card-hover
GET people I work with—people
GET all my planner tasks—tasks
GET my events for the next week—get-events-for-next-week
GET my photo—person-photo-only

Screenshot showing the Toolkit components tab with the code to generate the component highlighted

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.

Screenshot of the adaptive cards tab in Graph Explorer with the response details highlighted

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.

Screenshot of the Change theme option in Graph Explorer with the theme options highlighted

Store and share queries

Queries that are run in Graph Explorer are saved for 30 days on the History tab. On the History tab, you can:

  1. Export all history items in .har format.
  2. Delete all history items.
  3. View a history item.
  4. Run a query.
  5. Export a history item in .har format.
  6. Delete a history item.

Screenshot of the History tab with options highlighted

To share queries that you run, select the Share button in the response pane, and then select Copy. This copies a link to share that allows others to see your query and the results.

Screenshot of Graph Explorer with the Share and Copy options highlighted

Use Graph Explorer UI features

To widen the request and response area, collapse and expand the sidebar component in Graph Explorer. To collapse the sidebar component, select the hamburger icon on the top left of the sidebar.

Screenshot of Graph Explorer with the expand and collapse options highlighted

To expand and collapse the response preview, select the expand arrow in the response preview window.

Screenshot of the response pane with the expand and collapse options highlighted

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 settings gear, select Get a sandbox with sample data.

Screenshot of Graph Explorer with the Get a sandbox with sample data option highlighted

Next steps