Properties included in Sharepoint API “GET /sites/{siteId}/drives” response.

Ayase Morita 80 Reputation points
2025-01-28T02:33:02.94+00:00

I am using the “GET /sites/{siteId}/drives” endpoint of the Sharepoint API to retrieve a list of document libraries.

Within the value property in the API response are the createdBy, owner, and lastModifiedBy properties.

However, within those properties, there may be a user property and a group property. In addition, the owner and lastModifiedBy properties may not be returned in the first place.

So I have two questions.

(1) In what cases are the user and group properties included in the createdBy, owner, and lastModifiedBy properties?

(2) In what cases are owner and lastModifiedBy properties not returned?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,009 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,276 questions
0 comments No comments
{count} votes

Accepted answer
  1. RaytheonXie_MSFT 38,721 Reputation points Microsoft Vendor
    2025-01-28T08:46:17.3+00:00

    Hi @Ayase Morita,

    Per my test, The createdBy and lastModifiedBy properties will return user and owner usually returns group. Since the list owner is same with the site owner, and the site owner always be created as owner group as default. So the owner usually return group. Here is my library permission and graph response

    User's image

    User's image

    For owner and lastModifiedBy properties not returned, as explained in the documentation, the Graph API will return null values for attributes it does not have permissions to read:

    When an application queries a relationship that returns a directoryObject type collection, if it doesn't have permission to read a certain resource type, members of that type are returned but with limited information. For example, only the @odata.type property for the object type and the id is returned, while other properties are indicated as null. With this behavior, applications can request the least privileged permissions they need, rather than rely on the set of Directory.* permissions. For details, see Limited information returned for inaccessible member objects.


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

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

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.