Mark
Mark

Reputation: 1137

Listing shared drives in Google Drive

I'd like to list the Google Drive shared drives under my account. I'm using their Drives: list API to do so. Running it in the console succeeds but gives me an empty list of drives, and I can't find any clues as to why.

I looked at their docs for implementing shared drive support but none of it's relevant to listing drives.

Things I've checked:

Upvotes: 0

Views: 1796

Answers (1)

ziganotschka
ziganotschka

Reputation: 26836

Don't confuse shared drives with shared folders

  • A shared drive is something that is being created from the UI by clicking on Shared drives-> New shared drive... or programmaticaly with Drives:Create
  • A shared folder is a folder that is either on a user's private drive or a shared drive where you are not a member and only a specific folder (rather than the whole drive) has been shared with you by changing the sharing permissions.

Conclusion: You cannot retrieve folders that have been shread with you with the Drives:list method.

To retrieve folders that have been shared with you, you need to

  • use the method Files:list
  • set includeItemsFromAllDrives and supportsAllDrives to true
  • You can set the q parameter to mimeType = 'application/vnd.google-apps.folder' to narrow down results.

Upvotes: 2

Related Questions