how to find site id and drive id for graph API

Anjali Shevadkar 1 Reputation point

how to find site id and drive id for graph API

Microsoft Graph Applications API
Microsoft Graph Applications API
A Microsoft API that enables you to manage these resources and actions related to applications in Azure Active Directory.
506 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ShivaniRai-MSFT 2,681 Reputation points

    Hi @Anjali Shevadkar ,

    According to this document, use the below Graph API Endpoint to fetch the Id of a SharePoint site by passing site name{query}

    Example Reference: Here 'test' is the site name for which we want the site-Id. Grant permission to call this API (please refer below example screenshot from Graph Explorer)

    To fetch drive Id, these are the Endpoints you can use:

    GET /groups/{groupId}/drives (To fetch the drives within a group)  
    GET /sites/{siteId}/drives (To fetch drives for a particular site)  
    GET /users/{userId}/drives (To fetch user's drives)  
    GET /me/drives (To list the current user's drive)  

    Example reference: To fetch drive Id of a particular site. Grant Files.Read permission for this API(please refer below screenshot from Graph Explorer)

    Reference Docs:

    Hope this helps.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have further questions about this answer, please click "Comment".