Julian Docev
Julian Docev

Reputation: 119

Getting root id in Google Drive Api v3 in C#

I'm looking for a way to find the root folder id in Google Drive Api v3

In Google Drive Api v2 has a direct way t get the root folder ID:

string rootFolderID = (ServiceV2.About.Get().Execute()).RootFolderId;

How can I find the root id in v3?

Upvotes: 4

Views: 2599

Answers (1)

Tanaike
Tanaike

Reputation: 201603

How about this answer?

The official document says as follows.

You can use the alias root to refer to the root folder anywhere a file ID is provided

So you can use root as the root folder ID.

Note:

  • If you need to retrieve the actual root folder ID instead of root, how about using files.get method?
    • service.Files.Get("root").Execute()
    • By this, you can retrieve the actual root folder ID.

Reference:

If I misunderstood your question, I apologize.

Upvotes: 5

Related Questions