[[["易于理解","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"]],["最后更新时间 (UTC):2025-08-04。"],[],[],null,["# Track changes for users and shared drives\n\nFor Google Drive apps that need to keep track of changes to items in Drive, the\n[Changes collection](/workspace/drive/api/reference/rest/v3/changes) provides an efficient way to\ndetect changes. The collection works by providing the current state of each\nitem, if and only if the item has changed since a given point in time.\n\nGoogle Drive keeps a change log for each user and shared drive. Each has\ntheir own record of changes to items that are of interest to them.\n\nTo track changes for *all* items visible to a user, both the user change log and the\nchange logs for all shared drives the user is a member of need to be replayed.\n\nEnable change entries\n---------------------\n\nA change entry represents the state of the file or shared drive at a given point\nin time. A change does not provide a delta between revisions. Applications\nthat need to know which properties have changed should persist the\npreviously known state of the item and compare.\n\nSince changes represent the current state of an item, individual change\nentries may be invalidated and replaced with a newer change entry for\nthe corresponding item.\n\nTombstones\n----------\n\nChange entries for items no longer available to a user are marked as `deleted`\nin the change entry. Only the ID of the item is available in the change entry.\n| **Note:** Because change logs are scoped to a user or shared drive, a deleted item may still physically exist and be accessible by other users. The change entry does not distinguish between loss of access and deletion. When a file moves between corpora it may also appear as a delete even though the user still retains access to the file. If querying change logs for multiple corpora, use the `includeCorpusRemovals` query parameter to disambiguate corpus moves from loss of access.\n\nTrack shared drives\n-------------------\n\nEach shared drive has its own change log. Even though a user may be a member\nof a shared drive, certain changes are only reflected in the shared drive change\nlog and never in the user's change log. If a file belongs to a shared drive,\neven if the file still appeared on the user's change log at some point in the\npast, replaying the user's change log alone won't correctly update the file's\nstatus. Instead you must replay the shared drive's change log to capture all\nchanges.\n\n### What is included in a user's change log\n\nA user's change log includes changes to shared drives they're a member of as well\nas changes to files in the user's corpus. For more information about corpora, see [Changes and revisions overview](/workspace/drive/api/guides/change-overview).\n\nThese shared drive changes appear on the user's change log:\n\n- The user becomes a member of a shared drive.\n- The user is no longer a member of a shared drive.\n- There is a directly relevant change to a shared drive in which the user is a member, for example:\n - The user's access level on that shared drive changed.\n - The shared drive is renamed.\n\nWhen a user becomes a member of a shared drive, a single change event\nfor the shared drive appears in the user's change log. This implies\naccess to all items in the shared drive. The user does not receive changes for\nitems contained inside the shared drive when they become a member.\n\nMembers of a shared drive *may* see change events for items in a shared drive based\non their usage. However, applications should not rely on these events when the\nuser is a member of the shared drive. Instead, use the shared drive's change log to\ntrack changes.\n\nIf a non-member is granted file access to individual items in a shared drive,\nchanges to those items are tracked in the user's change log. This is the same\nas non-shared Drive items that are shared directly with users.\n\n### Changes that appear on a shared drive change log\n\nIf a user is a member of a shared drive, they can access that shared drive's change\nlog which contains:\n\n- Any changes to the shared drive itself, such as addition or removal of a member\n- Direct changes to the items contained in the shared drive.\n\n### Syncing permissions and capabilities\n\nPermission changes to shared drive or items inside a shared drive are only\nreflected on the item itself. While all direct or indirect children of that\nitem will inherit this change there will not be a separate entry in the change\nlog for each of those items. Clients must either\npropagate the new capabilities or refetch each item if a parent has\nchanged in order to fully reconstruct the changes."]]