I want to get all private folders(and files) for all users in one drive for business using REST API.

I got access token for https://mydomain-my.sharepoint.com using administrator account.

Now I am trying to get all private folders for all users using the below URL


I am able to get the list of files to the user whose credentials I used to get the access token.

But when I tried for any other user, I get only the files the user has shared.

How to get all the private folders of an user using REST API?

Any help would be appreciated

3 Answers 3


This can only be possible after the Admin is added to the Site Collection Owner group for other users. Once that is done, you can access their data. But keep in mind that this is a very lengthy activity.

Refer to this link to achieve it >>> http://blogs.technet.com/b/educloud/archive/2013/05/15/administrator-access-to-skydrive-pro.aspx

  • I accepted this as answer but I did this manually, can anybody help to do the same using REST API ??
    – user31420
    Sep 6, 2014 at 10:05
  • You could use a PowerShell script to automate the process as described in the comments of the link in the answer.
    – vinod
    Jan 7, 2015 at 21:03

In Azure AD add all the permissions that you can off SharePoint.

Use this endpoint for list all the folders:


folder_id = root, for the Root folder

This worked for me.

also you can get the list of all the sharepoint sites using this query:



I've done this by configuring an application in Azure that uses the SharePoint online API with full control of tenant application permissions. You need to get an app-only token using the client-credential oath flow. This way we can elevate privileges to full control thus enabling us to get private folders/files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.