0

I have created a Google service account and granted it Domain-Wide Delegation (DWD). I am trying to use the Google Drive API to list all files present in the domain, including both users' private files and shared files.

I'm making the following API request:

curl --location 'https://www.googleapis.com/drive/v3/files?includeItemsFromAllDrives=true&corpora=domain&supportsAllDrives=true' \
--header 'Authorization: Bearer ACCESS_TOKEN'

What Works:

✅ I am able to impersonate a user in the domain and successfully fetch all files for that user, which suggests that DWD is set up correctly.

Issue:

❌ The above API call does not return all files across the domain. What am I missing? Is there any additional scope, permission, or configuration required to retrieve all users' files within the domain?

Additional Details:

  • The service account has Domain-Wide Delegation enabled.
  • Using impersonation, I can fetch files for a specific user but not for the entire domain.
  • The required scopes for Google Drive API are already granted.

Would appreciate any insights! Thanks. 🚀

2
  • As far as I know, you may only get a list of files that are shared to you (in your case, the user has granted you permission to impersonate his account). You may opt for a shared drive for your workspace files so that you will have access to all shared files (as described in this post) Commented Mar 24 at 19:28
  • 1
    That command is not using a service account. nor is it using delegation can you show a full minimal reproducible example please Commented Mar 24 at 19:35

0

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.