Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#337 4 bình luận 6 reaction 1 người được giao Xem trên GitHub

@vinay-google đang làm issue này rồi.

Từ ngày 5/7/2022.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

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)'
   });
}
Ngôn ngữ chính
JavaScript
Star
5.2k
Fork
2k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của googleworkspace/apps-script-samples

Tất cả issue của googleworkspace/apps-script-samples

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.