Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#337 コメント 4 件 リアクション 6 件 担当者 1 名 GitHub で見る

@vinay-google がすでに取り組んでいます。

2022年7月5日 から。

評価

この issue はまだ評価されていません。

説明

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)'
   });
}
主要言語
JavaScript
スター
5.2k
フォーク
2k
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

googleworkspace/apps-script-samples のほかの issue

googleworkspace/apps-script-samples の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。