공유 드라이브는 내 드라이브와 다른 조직, 공유, 소유권 모델을 따릅니다. 앱이 공유 드라이브에서 파일을 만들고 관리하는 경우 앱에서 공유 드라이브 지원을 구현해야 합니다. 구현의 복잡성은 앱의 기능에 따라 다릅니다.
시작하려면 앱이 다음 작업을 실행할 때 요청에 supportsAllDrives=true 쿼리 매개변수를 포함해야 합니다.
Drive API v3
files.get
files.list
files.create
files.update
files.copy
files.delete
changes.list
changes.getStartPageToken
permissions.list
permissions.get
permissions.create
permissions.update
permissions.delete
Drive API v2
files.get
files.list
files.insert
files.update
files.patch
files.copy
files.trash
files.untrash
files.delete
files.touch
children.insert
parents.insert
changes.list
changes.getStartPageToken
changes.get
permissions.list
permissions.get
permissions.insert
permissions.update
permissions.patch
permissions.delete
supportsAllDrives=true 매개변수는 애플리케이션이 공유 드라이브의 파일을 처리하도록 설계되었음을 Google Drive에 알립니다.
권한을 읽거나 수정하고, 변경사항을 추적하거나, 여러 말뭉치에서 검색하는 애플리케이션에는 추가 공유 드라이브 기능이 필요합니다. 이 문서의 나머지 부분에서는 이러한 작업을 수행하는 데 필요한 추가 변경사항을 강조합니다.
공유 드라이브에서 콘텐츠 검색하기
files 리소스에서 list 메서드를 사용하여 공유 드라이브에서 사용자 파일을 찾습니다. 공유 드라이브를 검색하려면 공유 드라이브 검색하기를 참고하세요.
list 메서드에는 다음과 같은 공유 드라이브 관련 쿼리 매개변수가 포함됩니다.
driveId: 검색할 공유 드라이브의 ID입니다.
corpora: 쿼리가 적용되는 항목 (파일 또는 문서)의 본문입니다.
지원되는 본문은 user, domain, drive, allDrives입니다. 효율성을 위해 allDrives 대신 user 또는 drive를 사용하는 것이 좋습니다. 기본적으로 말뭉치는 user로 설정됩니다.
includeItemsFromAllDrives: 내 드라이브와 공유 드라이브 항목을 모두 결과에 포함할지 여부입니다. 이 값이 없거나 false로 설정된 경우 공유 드라이브 항목이 반환되지 않습니다.
supportsAllDrives: 요청하는 애플리케이션이 내 드라이브와 공유 드라이브를 모두 지원하는지 여부입니다. false인 경우 공유 드라이브 항목이 응답에 포함되지 않습니다.
다음 쿼리 모드는 공유 드라이브에만 해당합니다.
includeItemsFromAllDrives
corpora
쿼리 설명
true
user
공유 드라이브 파일과 내 드라이브 파일을 비롯하여 사용자가 액세스한 파일을 쿼리합니다.
true
domain
공유 드라이브 파일과 내 드라이브 파일을 모두 포함하여 도메인에 공유된 파일을 쿼리합니다.
true
drive
지정된 공유 드라이브의 모든 항목을 쿼리합니다. driveId은 요청에 지정해야 합니다.
true
allDrives
사용자가 액세스한 파일과 사용자가 멤버인 모든 공유 드라이브를 쿼리합니다. 응답에 incompleteSearch:true가 포함될 수 있으며, 이는 일부 말뭉치가 이 요청에 대해 검색되지 않았음을 나타냅니다.
[null,null,["최종 업데이트: 2025-08-13(UTC)"],[],[],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)"]]