Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Apps Script - Google Drive v2] The driveId parameter must be specified if and only if corpora is set to drive #337

Open
gopena-woolpert opened this issue Jul 5, 2022 · 2 comments
Assignees

Comments

@gopena-woolpert
Copy link

Summary

Getting an error when executing Google Drive (v2) Files.list even if corpora is set to 'drive' and driveId is supplied.

Expected Behavior

Google Drive API v2 Files.list method via Apps Script successfully retrieves files/folders under a Shared Drive when using corpora="drive" and supplying the driveId.

Sample URL:
Description:

Actual Behavior

Google Drive API v2 Files.list method via Apps Script fails with the following error:

Error in Apps Script logs:
Failed with error API call to drive.files.list failed with error: The driveId parameter must be specified if and only if corpora is set to drive.

Steps to Reproduce the Problem

  1. Create an Apps Script Project (setup OAuth)
  2. Add Google Drive (v2) library (v3 is not available)
  3. Copy and execute this function:
function getRetentionFolders() {
   const queryFolder = "trashed=false and mimeType='application/vnd.google-apps.folder'";
   var results = Drive.Files.list({
          corpora: "drive",
          id: <driveId of shared drive>,
          q: queryFolder,
          includeItemsFromAllDrives: true,
          supportsAllDrives: true,
          fields: 'items(kind,id,title,mimeType,createdDate,modifiedDate,parents,driveId)'
   });
}
@estellefr
Copy link

I'm also running into this same issue. Is there an ETA for a fix?

@mzvarik
Copy link

mzvarik commented Nov 30, 2023

Me too... zero clue... search also doesn't work without me specificing the "in parents" parameter which can't search subfolders... tf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@mzvarik @estellefr @vinay-google @gopena-woolpert and others