How to return all 'drives' from all sharepoint sites in a Graph API query?

ryan.graham 21 Reputation points
2021-07-26T19:28:33.073+00:00

Hello,

We've been trying to return all drives of all teams for the purpose of creating a report with each Sharepoint site's preservation hold library size. I'm able to pull a list of all groups using the below query:

https://graph.microsoft.com/v1.0/groups

Secondly, I'm able to pull a list of drives, including the preservation hold library size. from a single group using the below, via the group's ID.

https://graph.microsoft.com/v1.0/groups/<ID>/drives

Now, I'm not sure how to combine the two queries in order to pull a list of all drives from all groups. I've tried but have run into a dead-end and was wondering if this is possible? Seems like it should be...?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,675 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,704 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.
2,676 questions
0 comments No comments
{count} votes

Accepted answer
  1. MichaelHan-MSFT 18,016 Reputation points
    2021-07-27T02:22:12.19+00:00

    Hi @ryan.graham ,

    As far as I know, it's not possible to combine the two queries in one call.

    You need to send two different request calls to acheve this, one for getting all groups id, then another to loop through to get all drives.


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    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.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful