You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Create an Apps Script Project (setup OAuth)
Add Google Drive (v2) library (v3 is not available)
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)'
});
}
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: