קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
האחסון השיתופי פועל לפי מודלים שונים של ארגון, שיתוף ובעלות בהשוואה לתיקייה 'האחסון שלי'. אם האפליקציה שלכם יוצרת קבצים בתיקיות אחסון שיתופי ומנהלת אותם, אתם צריכים להטמיע באפליקציה תמיכה בתיקיות אחסון שיתופי. מידת המורכבות של ההטמעה תלויה בפונקציונליות של האפליקציה.
כדי להתחיל, צריך לכלול את פרמטר השאילתה supportsAllDrives=true בבקשות כשהאפליקציה מבצעת את הפעולות הבאות:
אפליקציות שקוראות או משנות הרשאות, עוקבות אחרי שינויים או מחפשות בכמה מאגרי מידע, דורשות יכולות נוספות של אחסון שיתופי. בהמשך המאמר הזה מפורטים שינויים נוספים שצריך לבצע כדי להשלים את המשימות האלה.
חיפוש תוכן באחסון שיתופי
כדי למצוא קבצים של משתמשים בתיקיות אחסון שיתופי, משתמשים בשיטה list במשאב files. הוראות לחיפוש תיקיות אחסון שיתופי מופיעות במאמר חיפוש תיקיות אחסון שיתופי.
השיטה list מכילה את פרמטרים השאילתה הבאים שספציפיים לאחסון השיתופי:
driveId: המזהה של האחסון השיתופי שרוצים לחפש בו.
corpora: גופי הפריטים (קבצים או מסמכים) שהשאילתה חלה עליהם.
הגופים הנתמכים הם user, domain, drive ו-allDrives. עדיפות ל-user או ל-drive על פני allDrives לצורך יעילות. כברירת מחדל, הערך של corpora הוא user.
includeItemsFromAllDrives: האם לכלול בתוצאות פריטים מ'האחסון שלי' ומאחסון שיתופי. אם המאפיין לא קיים או מוגדר כ-False, לא יוחזרו פריטים באחסון השיתופי.
supportsAllDrives: האם האפליקציה ששולחת את הבקשה תומכת גם ב'האחסון שלי' וגם באחסון השיתופי. אם הערך הוא False, פריטים באחסון שיתופי לא נכללים בתגובה.
מצבי השאילתה הבאים ספציפיים לאחסון שיתופי:
includeItemsFromAllDrives
corpora
תיאור השאילתה
true
user
שאילתות לגבי קבצים שהמשתמש ניגש אליהם, כולל קבצים באחסון השיתופי ובתיקיית 'האחסון שלי'.
true
domain
שאילתות לגבי קבצים ששותפו עם הדומיין, כולל קבצים בתיקיות אחסון שיתופי ובתיקיית 'האחסון שלי'.
true
drive
השאילתה מחפשת את כל הפריטים בתיקיית האחסון השיתופי שצוינה. צריך לציין את driveId בבקשה.
true
allDrives
שאילתת קבצים שהמשתמש ניגש אליהם וכל תיקיות האחסון השיתופי שהוא חבר בהן. שימו לב: יכול להיות שהתשובה תכלול את הסימן incompleteSearch:true, שמציין שחלק מהמאגרים לא נבדקו במסגרת הבקשה הזו.
השיטה list מכילה את פרמטרים השאילתה הבאים שספציפיים לאחסון השיתופי:
driveId: האחסון השיתופי שממנו מוחזרים השינויים. אם מצוין,
מזהי השינויים מתייחסים לשינויים בפריטים באחסון השיתופי, ומספקים את המצב הנוכחי של קובץ. כדי להתייחס לשינוי ספציפי באחסון השיתופי, צריך להשתמש במזהה של האחסון השיתופי ובמזהה של השינוי.
includeItemsFromAllDrives: האם לכלול ברשימת השינויים קבצים או שינויים בתיקיות אחסון שיתופי.
supportsAllDrives: האם האפליקציה ששלחה את הבקשה תומכת באחסון שיתופי. אם הערך הוא false, לא מוחזרים פריטים באחסון שיתופי, כולל תיקיות באחסון שיתופי וקבצים בתוך אחסון שיתופי.
מצבי השאילתה הבאים ספציפיים לאחסון שיתופי:
includeItemsFromAllDrives
driveId
תיאור השאילתה
true
לא
השינויים משקפים שינויים בקבצים בתוך תיקיות אחסון שיתופי או מחוצה להן שהמשתמש ניגש אליהם, וגם שינויים בתיקיות אחסון שיתופי שהמשתמש חבר בהן.
true
כן
השינויים משקפים שינויים באחסון השיתופי הספציפי שצוין ובפריטים בתוך האחסון השיתופי הזה.
כדי לגשת לתוכן בתיקיית אחסון שיתופי באמצעות ממשק המשתמש של Drive, צריך לוודא שסימנתם את התיבה Shared drives support (תמיכה בתיקיות אחסון שיתופי) בכרטיסייה Drive UI integration (שילוב ממשק המשתמש של Drive) של Google Drive API במסוף Google Cloud. מידע נוסף זמין במאמר הגדרת שילוב של ממשק משתמש של Drive.
שימוש בכלי לבחירת קבצים של Google עם תיקיות אחסון שיתופי
כלי הבחירה של Google תומך בבחירת פריטים בתיקיות אחסון שיתופי. פרטים על הפעלת התמיכה באחסון שיתופי והוספת תצוגות של אחסון שיתופי בכלי לבחירת קבצים זמינים במאמר בנושא Google Picker API.
[[["התוכן קל להבנה","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-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)"]]