2

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

https://mydomain-my.sharepoint.com/personal/user_domain_onmicrosoft_com/_api/files

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

0

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

2
  • 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
0

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

Use this endpoint for list all the folders:

https://mydomain-my.sharepoint.com/personal/user_domain_onmicrosoft_com/_api/v1.0/files/{folder_id}/children

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:

https://{tenant}.sharepoint.com/_api/search/query?querytext='contentclass:sts_site+contentclass:sts_web'

0

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 that you have read and understand our privacy policy and code of conduct.

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