Skip to content
Skip to content
Menu
A cup of dev
  • Home
  • About
  • Contact
  • Books and ink
A cup of dev

How to Get Site-ID with Graph Explorer (and other SharePoint info)

By Eli H. Schei on Tuesday, 6 May 2025, 11:38Thursday, 26 June 2025, 11:44

If you’re working with Microsoft Graph and SharePoint, you’ll often need IDs like the site-id, list-id, or drive-id. A quick way to get these is using Microsoft’s tool: Graph Explorer. In this post, you’ll learn how to get site-id with Graph Explorer, along with other useful details you’ll need for scripting, automation, or app development.

Prerequesites: The user you are using to log in to Graph Explorer must have permissions to the resources you are requesting.

Open Graph Explorer

Start by visiting https://developer.microsoft.com/graph/graph-explorer.
Log in with your Microsoft 365 account to access your organization’s SharePoint data.

You can do so by clicking the profile icon in the upper right corner. After loging in the “Tenant” will show your tenant name instead of ‘sample’.

Get Site-Id

There are two ways you can go about doing this, the first one is by search

https://graph.microsoft.com/v1.0/sites?search=your-site-name

This will potentially give you multiple responses, so scroll through and find the one with the name your actually searching for. The site-id is the value named 'id'.

It will look like this:

{
  "id": "yourdomain.sharepoint.com,SOME_GUID,ANOTHER_GUID"
}

The other way to get your site is if you know the specific site-url you can build the graph query like this

https://graph.microsoft.com/v1.0/sites/YOUR_DOMAIN.sharepoint.com:/sites/NAME_OF_SITE/

And the result will be similar to the one above – but this wont have a ‘value’ array first – it will give you the site info directly

Getting other information

When you have the site-id you can use it to get other resources like like lists, drives etc. This is usefull if you are using graph to to CRUD operations (create, read, update, delete).

Get drive id or list id

To get drive-id or list-id you simply need to do a request to

//Drives
https://graph.microsoft.com/v1.0//sites/{site-id}/drives

//Lists
https://graph.microsoft.com/v1.0//sites/{site-id}/lists

Get items

When you have the drive or list id you can use that to get items from the list/drive

//Drives
https://graph.microsoft.com/v1.0//sites/{site-id}/drives/{drive-id}/items

//Lists
https://graph.microsoft.com/v1.0//sites/{site-id}/lists/{list-id}/items

Final Tips

Always make sure to log in in Graph Explorer to access organizational data.

If something doesn’t show up, you might need additional Graph permissions (e.g., Sites.Read.All).

Use the “Access token” tab to inspect what permissions are in use.


If you are interested in Microsoft 365 Development you might also like my other blogposts in this category.

Also, if you have any feedback or questions, please let me know in the comments below. 🙂

Thank you for reading, and happy coding!

/Eli

If you want to support my content you can

Share this:

  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on X (Opens in new window) X

Post navigation

How to use Azure CLI to deploy Azure Functions: Step-by-Step Guide

Leave a ReplyCancel reply

Eli H. Schei

I'm a front-end developer who mainly work in the Microsoft 365-sphere. As a developer I read a lot of blogs. And in my experience I can read multiple different blogposts about exactly the same topic, and only one of them makes sense to me. Therefore I’m adding my voice to the mix, and hopefully one of my blogposts will be the one that makes sense of a topic for you. You can learn more about me here.

Recent Posts

  • How to Get Site-ID with Graph Explorer (and other SharePoint info)
  • How to use Azure CLI to deploy Azure Functions: Step-by-Step Guide
  • Give your app granular permissions to a specific site or list in SharePoint
  • Microsoft Graph Magic: Simplifying User Removal from teams in Microsoft Teams
  • How to leverage teams-js in your Teams app; Working with user context and SharePoint site context

Categories

  • Azure
    • Azure CLI
    • Azure functions
  • Level
    • Beginner
    • Intermediate
  • Microsoft 365 Development
    • Microsoft Authentication Library
    • Microsoft Graph
    • Microsoft Teams
    • PNP powershell
    • PowerApps
      • PowerApps Component Framework
    • SharePoint Framework
    • SharePoint Online
  • Tech Lead
  • Web development
    • Accessibility
    • Soft skills
    • Tips and tricks

Tags

accessibility app permissions ARIA azure Azure CLI azure functions Content creation custom themes favorites git github M365 CLI M365 development MS Graph PCF PnPjs PnP powershell power apps PowerApps Component Framework quicktip react resources SharePoint Online Sideloading SPfx Teams teams app dev Teams apps Tech lead tools wcag webdev Windows terminal
©2025 A cup of dev | WordPress Theme by SuperbThemes.com