Google Drive API バージョン 2 を使用している場合、Google Drive API ガイド v3 のコンテンツのほとんどは v2 にも当てはまります。このセクションには、v2 固有の情報がすべて含まれています。これは、v3 ガイドの特定のページに表示される情報とは異なります。各サブセクションには、対応するガイドページへのリンクが含まれています。
ファイルのリビジョンのリストを取得したら、承認済みの GET リクエストをその []downloadUrl](/workspace/drive/api/reference/rest/v2/revisions) プロパティに送信して、任意のリビジョンのコンテンツをダウンロードできます。この有効期間の短い URL は、リビジョンをリクエストすると Google ドライブによって生成されます。後で使用するために、これに依存しないでください。
Google ドライブでファイルを作成する際に、一部の種類のファイルを Google ドキュメント、Google スプレッドシート、Google スライドのドキュメントに変換できます。files.insertconvert クエリ パラメータを含め、ファイルの(workspace_name)mimeType プロパティを設定します。詳細については、ファイルデータをアップロードするをご覧ください。
ファイル、フォルダ、ドライブを共有する
ファイル、フォルダ、ドライブを共有するページの注意書きにあるように、v3 では 1 つのフィールド role のみで、ユーザー、グループ、ドメインの有効なロールを指定します。v2 では、権限の role フィールドと additionalRoles フィールドの両方に、ユーザー、グループ、ドメインが特定のアイテムに対して持つ有効なロールが反映されている必要があります。
v2 の検索クエリの違い
v2 の title フィールドは、v3 では name です。例については、ファイルとフォルダを検索するをご覧ください。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-08-29 UTC。"],[],[],null,["# Guide to Drive API v2\n\nIf you use Google Drive API version 2, most of the content in the [Google Drive API\nGuide](/workspace/drive/api/guides/about-sdk) v3 pertains to v2 as well. This section\ncontains all of the information that's v2-specific, and different from what's\nshown in specific pages of the v3 guide. To get full context, each sub-section\ncontains the link to the corresponding guide page.\n\nFor a complete list of differences, see [Drive API v2 \\& v3 comparison\nreference](/workspace/drive/api/guides/v2-to-v3-reference).\n\nDownload \\& publish file revisions\n----------------------------------\n\nOn the [Download \\& publish file revisions](/workspace/drive/api/guides/manage-revisions)\npage, the following information is specific to v2, and replaces these sections\nshown for v3:\n\n### List \\& download individual revisions\n\nOnce you get a list of a file's revisions, you can download the content of any\nrevision by sending an authorized `GET` request to its\n\\[\\]`downloadUrl`\\](/workspace/drive/api/reference/rest/v2/revisions) property.\nGoogle Drive generates this short-lived URL when you request the revision.\nDon't rely on it for later use.\n\nYou can also export the revision in one of the supported formats by checking the\n`exportLinks` property.\n\nCustom file properties\n----------------------\n\nIn addition to the information on the [Add custom file properties](/drive/api/guides/properties) page, the following information is specific to v2:\n\nProperties are accessed using the\n[`properties`](/workspace/drive/api/reference/rest/v2/properties) resource.\n\nThis is the structure of a typical property that might be used to store a\nDrive file's database ID on the file. \n\n {\n 'key': 'additionalID',\n 'value': '\u003cvar translate=\"no\"\u003eID\u003c/var\u003e',\n 'visibility': 'PRIVATE'\n }\n\nFor more information about limits, see\n[`properties`](/workspace/drive/api/reference/rest/v2/properties) in the\nreference documentation.\n\nEnable shared drive support\n---------------------------\n\nIn addition to the information on the [Implement shared drive support](/workspace/drive/api/guides/enable-shareddrives) page, replace this additional field\n[`trashedDate`](/workspace/drive/api/v2/reference/files) for v2.\n\nIn [Implement shared drive support](/workspace/drive/api/guides/enable-shareddrives), the\nfollowing methods require `supportsAllDrives=true` when working with shared\ndrives content:\n\n- `files.get`\n- `files.list`\n- `files.insert`\n- `files.update`\n- `files.patch`\n- `files.copy`\n- `files.trash`\n- `files.untrash`\n- `files.delete`\n- `files.touch`\n- `children.insert`\n- `parents.insert`\n- `changes.list`\n- `changes.getStartPageToken`\n- `changes.get`\n- `permissions.list`\n- `permissions.get`\n- `permissions.insert`\n- `permissions.update`\n- `permissions.patch`\n- `permissions.delete`\n\nThe `changes.get` and `changes.list` methods have several parameters specific to\nshared drives. For a list of parameters, see [Track changes on a shared\ndrive](/workspace/drive/api/guides/enable-shareddrives#track_changes_on_a_shared_drive)\nsection.\n\nUpload files\n------------\n\nOn the [Upload file data](/workspace/drive/api/guides/manage-uploads) page, notice this\ninformation is specific to v2:\n\n### Import to Google Docs types\n\nWhen you create a file in Google Drive, you can convert some types file into a\nGoogle Docs, Google Sheets, or Google Slides document. Include the\n[`files.insert`](/workspace/drive/api/reference/rest/v2/files/insert) `convert` query\nparameters and set the (workspace_name) `mimeType` property of the file. For\nmore information, see [Upload file\ndata](/workspace/drive/api/guides/manage-uploads#import-docs).\n\nShare files, folders \\& drives\n------------------------------\n\nNotice on the [Share files, folders \\& drives](/workspace/drive/api/guides/manage-sharing)\npage, in v3 only one field, `role`, specifies effective roles for user, group,\nor domain. In v2, you need both `role` and `additionalRoles` fields of a\npermission reflect the effective roles the user, group, or domain have for a\ngiven item.\n\nSearch query differences for v2\n-------------------------------\n\nThe v2 `title` field is `name` in v3. For examples, see [Search for files \\&\nfolders](/workspace/drive/api/guides/search-files).\n\nThe v2 `createdDate` field is `createdTime` in v3. For examples, see [Search for\nshared drives](/workspace/drive/api/guides/search-shareddrives).\n\nThe v2 `modifiedDate` field is `modifiedTime` in v3. The v2 `lastViewedByMeDate`\nfield is `viewedByMeTime` in v3. For more details, see [Search query terms \\&\noperators](/workspace/drive/api/guides/ref-search-terms)."]]