How to Identify the Default Document Library in the Response from GET /sites/{siteId}/drives?

Takamoto Ide 40 Reputation points
2025-01-22T01:19:00.2333333+00:00

I am using the API endpoint "GET /sites/{siteId}/drives" to retrieve a list of libraries. I would like to inquire about how to identify the default document library within the response.

Specifically, I would appreciate answers to the following questions:

  1. In the response from "GET /sites/{siteId}/drives", is there a specific flag or property that indicates the default document library?
  2. If such a flag or property does not exist, could you provide the recommended method or best practices for identifying the default document library?

Thank you for your assistance.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,045 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,289 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ling Zhou_MSFT 21,495 Reputation points Microsoft Vendor
    2025-01-22T05:18:20.8+00:00

    Hi @Takamoto Ide,

    Thanks for your trust and we are pleased to offer assistance.

    Based on the description and the research I have done, does the default file repository refer to the 'Documents' section located in the left navigation bar after creating a site? Please feel free to correct me if there is anything wrong.

    User's image

    If there is not anything wrong, it is suggested that you please note these properties:

    • name: The name of the document library is Documents.
    • webUrl: The URL path to the document library contains Shared%20Documents.
    • createdBy: The document library is created by the System Account.

    User's image

    If you have any questions, please do not hesitate to contact me.

    Moreover, if the issue can be fixed successfully, please click “Accept Answer” so that we can better archive the case and the other community members who are suffering the same issue can benefit from it.

    Your kind contribution is much appreciated.


1 additional answer

Sort by: Most helpful
  1. Saranya Madhu-MSFT 1,425 Reputation points Microsoft Vendor
    2025-01-22T05:07:50.0066667+00:00

    Hi Takamoto Ide,

    Thanks for reaching out to Microsoft!

    As per Microsoft documentation, to access a Site's default document library, your app requests the drive relationship on the Site.

    GET /sites/{siteId}/drive
    

    GET /sites/{siteId}/drives, there isn't a specific flag or property that directly indicates the default document library. The response will include a list of drives (document libraries) associated with the site, but it doesn't explicitly mark the default one.

    Hope this helps.

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

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.