[null,null,["最后更新时间 (UTC):2025-08-13。"],[],[],null,["# Implement shared drive support\n\nShared drives follow different organization, sharing, and ownership models from\nMy Drive. If your app is going to create and manage files on\nshared drives, you must implement shared drive support in your app. The\ncomplexity of your implementation depends on the functionality of your app.\n\nTo begin, you must include the `supportsAllDrives=true` query parameter in your\nrequests when your app performs the following operations: \n\n### Drive API v3\n\n- `files.get`\n- `files.list`\n- `files.create`\n- `files.update`\n- `files.copy`\n- `files.delete`\n- `changes.list`\n- `changes.getStartPageToken`\n- `permissions.list`\n- `permissions.get`\n- `permissions.create`\n- `permissions.update`\n- `permissions.delete`\n\n### Drive API v2\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 `supportsAllDrives=true` parameter informs Google Drive that your\napplication is designed to handle files on shared drives.\n\nApplications that read or modify permissions, track changes, or search across\nmultiple corpora require additional shared drive capabilities. The remainder of\nthis document highlights additional changes required to perform these tasks.\n\nSearch for content on a shared drive\n------------------------------------\n\nUse the [`list`](/workspace/drive/api/reference/rest/v3/files/list) method on the [`files`](/workspace/drive/api/reference/rest/v3/files) resource to find user files in shared drives. To\nsearch for a shared drive, see [Search for shared\ndrives](/workspace/drive/api/guides/search-shareddrives).\n\nThe `list` method contains the following shared drive-specific query parameters:\n\n- `driveId`: ID of the shared drive to search.\n\n- `corpora`: Bodies of items (files or documents) to which the query applies.\n Supported bodies are `user`, `domain`, `drive`, and `allDrives`. Prefer\n `user` or `drive` to `allDrives` for efficiency. By default, corpora is set\n to `user`.\n\n- `includeItemsFromAllDrives`: Whether both My Drive and shared\n drive items should be included in results. If not present or set to false,\n then shared drive items are not returned.\n\n- `supportsAllDrives`: Whether the requesting application supports both My\n Drive and shared drive. If false, shared drive items are not\n included in the response.\n\nThe following query modes are specific to shared drives:\n\n| `includeItemsFromAllDrives` | `corpora` | Query description |\n|-----------------------------|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `true` | `user` | Queries files that the user has accessed, including both shared drive and My Drive files. |\n| `true` | `domain` | Queries files that are shared to the domain, including both shared drive and My Drive files. |\n| `true` | `drive` | Queries all items in the specified shared drive. The `driveId` must be specified in the request. |\n| `true` | `allDrives` | Queries files that the user has accessed and all shared drives in which they're a member. Note that the response might include `incompleteSearch:true`, indicating that some corpora were not searched for this request. |\n\nTrack changes on a shared drive\n-------------------------------\n\nUse the [`list`](/workspace/drive/api/reference/rest/v3/changes/list) method on the [`changes`](/workspace/drive/api/reference/rest/v3/changes) resource to track changes on a shared drive. For\nmore information, see [Track changes for users and shared\ndrives](/workspace/drive/api/guides/about-changes).\n\nThe `list` method contains the following shared drive-specific query parameters:\n\n- `driveId`: The shared drive from which changes are returned. If specified,\n the change IDs refer to changes to items within the shared drive providing\n the current state of a file. To refer to a specific shared drive change,\n both the shared drive ID and change ID must be used as an identifier.\n\n- `includeItemsFromAllDrives`: Whether shared drive files or changes should be\n included in the list of changes.\n\n- `supportsAllDrives`: Whether the requesting application supports shared\n drives. If false, then shared drive items, including both shared drives and\n files within a shared drive, aren't returned.\n\nThe following query modes are specific to shared drives:\n\n| `includeItemsFromAllDrives` | `driveId` | Query description |\n|-----------------------------|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `true` | No | Changes are reflective of changes to files inside or outside of shared drives that the user has accessed, as well as changes to shared drives in which the user is a member. |\n| `true` | Yes | Changes are reflective of changes to the particular shared drive that was specified and items inside that shared drive. |\n\n| **Note:** If you're using the older Drive API v2, the [`get`](/workspace/drive/api/reference/rest/v2/changes/get) and [`list`](/workspace/drive/api/reference/rest/v2/changes/list) methods have several parameters specific to shared drives.\n\nFor additional details about change log behavior, see [Track changes for users\nand shared drives](/workspace/drive/api/guides/about-changes).\n\nEnable shared drive support in the Drive UI\n-------------------------------------------\n\nTo access shared drive content using the Drive UI, make sure you\nhave checked the\n**Shared drives support** box on the **Drive UI integration** tab\nof the Google Drive API in the\n[Google Cloud console](https://console.cloud.google.com/apis/dashboard). For more\ninformation, see [Configure a Drive UI integration](/workspace/drive/api/guides/enable-sdk).\n\nUse the Google Picker with shared drives\n----------------------------------------\n\nThe [Google Picker](/workspace/drive/api/guides/picker) supports selecting items in shared\ndrives. For details about enabling shared drive support and adding shared drives\nviews in the picker, see the [Google Picker API](/drive/picker/reference/picker).\n\nRelated topics\n--------------\n\n- [Manage shared drives](/workspace/drive/api/guides/manage-shareddrives)"]]