Perbedaan drive bersama versus Drive Saya API
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Drive bersama mengikuti model organisasi, berbagi, dan kepemilikan yang berbeda dari Drive Saya. Oleh karena itu, beberapa operasi Drive Saya tidak diizinkan untuk konten di drive bersama.
Panduan ini menguraikan perbedaan API khusus drive bersama di resource files
dan
changes
.
Resource file
Kolom berikut dalam resource files
hanya diisi untuk file yang berada dalam drive bersama:
hasAugmentedPermissions
: Apakah ada pengguna yang diberi akses file
langsung ke file ini.
capabilities/canAddFolderFromAnotherDrive
: Apakah pengguna saat ini dapat
menambahkan folder dari drive lain (drive bersama yang berbeda atau Drive
Saya) ke folder ini.
capabilities/canDeleteChildren
: Apakah pengguna saat ini dapat menghapus turunan folder ini.
capabilities/canMoveChildrenOutOfDrive
: Apakah pengguna saat ini dapat memindahkan
turunan folder ini ke luar drive bersama.
capabilities/canMoveChildrenWithinDrive
: Apakah pengguna saat ini dapat memindahkan
turunan folder ini dalam drive bersama.
capabilities/canMoveItemWithinDrive
: Apakah pengguna saat ini dapat memindahkan
item drive bersama ini dalam drive bersama.
capabilities/canReadDrive
: Apakah pengguna saat ini memiliki akses baca ke
drive bersama tempat file ini berada.
capabilities/canTrashChildren
: Apakah pengguna saat ini dapat memindahkan turunan
folder ini ke sampah.
driveId
: ID drive bersama tempat file berada.
trashingUser
: Jika file telah dihapus secara eksplisit, pengguna yang
menghapusnya.
trashedTime
: Waktu saat item dihapus ke sampah. Jika Anda menggunakan
Drive API v2 yang lebih lama, kolom ini disebut trashedDate
.
Kolom berikut tidak diisi untuk file yang berada dalam drive bersama:
permissions
: Karena potensi ukuran daftar kontrol akses (ACL) drive bersama, izin tidak ditampilkan sebagai bagian dari file. Gunakan metode
permissions.list
, yang mendukung penomoran halaman, untuk mencantumkan izin
untuk file dalam folder drive bersama atau folder drive bersama.
owners
, ownerNames
, ownedByMe
: File dalam drive bersama dimiliki oleh drive bersama, bukan pengguna perorangan.
folderColorRgb
: Folder tidak dapat diberi warna satu per satu.
shared
: Semua item di drive bersama dibagikan.
writersCanShare
: Berbagi tidak dapat dibatasi menurut peran di drive
bersama.
Kolom berikut hanya disetel jika pengguna telah diberi izin akses file
pada suatu item:
sharedWithMeDate
sharingUser
Kolom berikut memerlukan pertimbangan khusus saat Anda menggunakannya dengan drive bersama:
parents.isRoot
: Kolom ini hanya benar untuk folder root Drive Saya; salah untuk folder tingkat teratas drive bersama.
parents
: Orang tua tidak muncul dalam daftar orang tua jika pengguna yang meminta
bukan anggota drive bersama dan tidak memiliki akses ke
orang tua. Selain itu, dengan pengecualian folder tingkat teratas, daftar
induk harus berisi tepat satu item jika file berada dalam drive
bersama.
capabilities/canRemoveChildren
: Gunakan capabilities/canDeleteChildren
atau
capabilities/canTrashChildren
.
Mengubah resource
Kolom baru berikut tersedia di resource
changes
untuk drive bersama:
changeType
: Jenis perubahan. Nilai yang mungkin adalah file
dan drive
.
driveId
: ID drive bersama yang terkait dengan perubahan ini.
drive
: Status terbaru dari drive bersama. Ditampilkan jika changeType
adalah drive
dan pengguna masih menjadi anggota drive bersama.
Perubahan tambahan mungkin diperlukan untuk aplikasi yang perlu menyinkronkan konten
dengan drive bersama atau melacak aktivitas. Untuk mengetahui detailnya, lihat Melacak perubahan untuk pengguna dan drive bersama.
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-08-29 UTC.
[null,null,["Terakhir diperbarui pada 2025-08-29 UTC."],[],[],null,["# Shared drive versus My Drive API differences\n\nShared drives follow different organization, sharing, and ownership models from\na My Drive. As such, some My Drive operations\naren't permitted for content in a shared drive.\n\nThis guide outlines shared drive-specific API differences in the `files` and\n`changes` resources.\n\nFile resource\n-------------\n\nThe following fields in the [`files`](/workspace/drive/api/reference/rest/v3/files) resource are\nonly populated for files located within a shared drive:\n\n- `hasAugmentedPermissions`: Whether any users are granted file access directly on this file.\n- `capabilities/canAddFolderFromAnotherDrive`: Whether the current user can add a folder from another drive (a different shared drive or My Drive) to this folder.\n- `capabilities/canDeleteChildren`: Whether the current user can delete children of this folder.\n- `capabilities/canMoveChildrenOutOfDrive`: Whether the current user can move children of this folder outside of the shared drive.\n- `capabilities/canMoveChildrenWithinDrive`: Whether the current user can move children of this folder within the shared drive.\n- `capabilities/canMoveItemWithinDrive`: Whether the current user can move this shared drive item within the shared drive.\n- `capabilities/canReadDrive`: Whether the current user has read access to the shared drive to which this file belongs.\n- `capabilities/canTrashChildren`: Whether the current user can trash children of this folder.\n- `driveId`: The ID of the shared drive where the file is located.\n- `trashingUser`: If the file has been explicitly trashed, the user who trashed it.\n- `trashedTime`: The time that the item was trashed. If you're using the older Drive API v2, this field is called `trashedDate`.\n\nThe following fields aren't populated for files located within a shared drive:\n\n- `permissions`: Due to the potential size of shared drive access control lists (ACLs), permissions aren't returned as part of files. Use the `permissions.list` method, which supports pagination, to list permissions for a file within a shared drive or the shared drive folder.\n- `owners`, `ownerNames`, `ownedByMe`: Files within a shared drive are owned by the shared drive, not individual users.\n- `folderColorRgb`: Folders cannot be colored individually.\n- `shared`: All items in a shared drive are shared.\n- `writersCanShare`: It's not possible to restrict sharing by role in shared drives.\n\nThe following fields are only set when the user has been granted file access\npermissions on an item:\n\n- `sharedWithMeDate`\n- `sharingUser`\n\nThe following fields require special consideration when you use them with shared\ndrives:\n\n- `parents.isRoot`: This field is only true for the My Drive root folder; it's false for the shared drive top-level folder.\n- `parents`: A parent doesn't appear in the parents list if the requesting\n user isn't a member of the shared drive and doesn't have access to the\n parent. In addition, with the exception of the top level folder, the parents\n list must contain exactly one item if the file is located within a shared\n drive.\n\n | **Note:** If you're using the older Drive API v2:\n | - `shareable`: Deprecated. Use `capabilities/canShare`.\n | - `editable`: Deprecated. Use `capabilities/canEdit`.\n | - `copyable`: Deprecated. Use `capabilities/canCopy`.\n | - `canComment`: Deprecated. Use `capabilities/canComment`.\n | - `canReadRevisions`: Deprecated. Use `capabilities/canReadRevisions`.\n- `capabilities/canRemoveChildren`: Use `capabilities/canDeleteChildren` or\n `capabilities/canTrashChildren`.\n\nChange resource\n---------------\n\nThe following new fields are available in the\n[`changes`](/workspace/drive/api/reference/rest/v3/changes) resource for a shared drive:\n\n- `changeType`: The change type. Possible values are `file` and `drive`.\n- `driveId`: The ID of the shared drive associated with this change.\n- `drive`: The updated state of the shared drive. Present if the `changeType` is `drive` and the user is still a member of the shared drive.\n\nAdditional changes might be required for applications that need to sync content\nwith shared drives or track activity. For details, see [Track changes for users\nand shared drives](/workspace/drive/api/guides/about-changes).\n\nRelated topics\n--------------\n\n- [Files and folders overview](/workspace/drive/api/guides/about-files)\n- [Changes and revisions overview](/workspace/drive/api/guides/change-overview)"]]