Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
L'API Google Drive Activity è costituita dalla risorsa
DriveActivity, che
rappresenta le modifiche apportate agli oggetti all'interno di Google Drive di un utente, e dal metodo
activity.query, che consente di recuperare
informazioni su queste modifiche.
Richiesta
La tua app richiede i dati delle attività di un utente utilizzando il metodo
activity.query. Puoi richiedere l'attività
per un elemento specifico di Drive o per tutto ciò che è contenuto in una cartella
di Drive. Per una determinata richiesta, puoi scegliere di limitare la risposta in base a
vincoli come intervallo di tempo o tipo di azione e puoi
scegliere di consolidare l'attività nella
risposta. Per ulteriori informazioni, consulta Effettuare richieste nell'API Drive Activity.
Risposta
La risposta a una richiesta è un elenco di attività corrispondenti ai parametri specificati,
in cui una risorsa
DriveActivity rappresenta ogni attività:
Una risorsa DriveActivity è una raccolta di oggetti Action, ognuno dei quali è autonomo come un evento. Un Action include un
ActionDetail (ad esempio Create
o Edit), un Actor (ad esempio User
o Administrator), un Target (ad esempio
DriveItem o Drive) e un
Timestamp
o un TimeRange.
Una risorsa DriveActivity contiene anche
informazioni di riepilogo, come ogni Actor e
Target di tutte le azioni, un Timestamp
o TimeRange unificato e il ActionDetail
più importante o rappresentativo
del Action.
Alcune attività su Drive potrebbero non essere segnalate quando utilizzi questa API. Se l'API Drive Activity segnala una determinata modifica a un oggetto dipende dal fatto che la modifica o le informazioni sulla modifica siano visibili all'utente autenticato nella tua applicazione.
La visibilità si basa sulle autorizzazioni impostate per l'oggetto. Esistono diversi
scenari in cui file e cartelle vengono condivisi in Drive:
Se un autore condivide un documento, la cronologia delle attività
è visibile non solo al creator, ma anche agli utenti autenticati
con cui è stato condiviso.
Se un documento è stato condiviso con un utente e poi reso privato, l'utente autenticato
può visualizzare tutta la cronologia attività durante il periodo in cui aveva accesso e che ora le autorizzazioni sono
limitate.
Se un documento non è mai stato condiviso con un utente, quest'ultimo non può visualizzare alcuna cronologia
dell'attività.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-08-04 UTC."],[],[],null,["# Introduction to Google Drive Activity API\n\nThe Google Drive Activity API consists of the\n[`DriveActivity`](/workspace/drive/activity/v2/reference/rest/v2/activity/driveactivity) resource, which\nrepresents changes made to objects within a user's Google Drive, and the\n[`activity.query`](/workspace/drive/activity/v2/reference/rest/v2/activity/query) method, which allows you to retrieve\ninformation about those changes.\n\nRequest\n-------\n\nYour app requests a user's activity data using the\n[`activity.query`](/workspace/drive/activity/v2/reference/rest/v2/activity/query) method. You can request activity\neither for a specific Drive item or for everything contained under a Drive\nfolder. For a given request, you can choose to restrict the response by\n[constraints](/workspace/drive/activity/v2/requests#filters) such as time range or action type, and you\ncan choose to have the activity [consolidated](/workspace/drive/activity/v2/requests#consolidation) in the\nresponse. For more information, see [Make requests in the Drive Activity API](/workspace/drive/activity/v2/requests).\n\nResponse\n--------\n\nThe response to a request is a list of activities matching the given parameters,\nwhere a\n[`DriveActivity`](/workspace/drive/activity/v2/reference/rest/v2/activity/driveactivity) resource represents each activity:\n\nA [`DriveActivity`](/workspace/drive/activity/v2/reference/rest/v2/activity/driveactivity) resource is a collection of\n[`Action`](/workspace/drive/activity/v2/reference/rest/v2/activity/action) objects, each of which is\nself-contained like an *event* . An `Action` includes an\n[`ActionDetail`](/workspace/drive/activity/v2/reference/rest/v2/activity/actiondetail) (such as `Create`\nor `Edit`), an [`Actor`](/workspace/drive/activity/v2/reference/rest/v2/activity/actor) (such as `User`\nor `Administrator`), a [`Target`](/workspace/drive/activity/v2/reference/rest/v2/activity/target) (such\nas `DriveItem` or `Drive`), and either a\n[`Timestamp`](/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp)\nor [`TimeRange`](/workspace/drive/activity/v2/reference/rest/v2/activity/timerange).\n\nA `DriveActivity` resource also contains\nsummary information, such as every\n`Actor` and\n`Target` from all the actions, a unified\n`Timestamp`\nor `TimeRange`, and either the most\nimportant or representative\n`ActionDetail` of the\n`Action`.\n\nFor more information, see the [Drive Activity API data model](/workspace/drive/activity/v2/datamodel).\n\nActivity history visibility\n---------------------------\n\nSome activity on Drive may not be reported when you use this API. Whether the\nDrive Activity API reports a given change to an object depends on whether\nthe change, or information about the change, is visible to the authenticated\nuser in your application.\n\nVisibility is based on the permissions set for the object. There's several\nscenarios when files and folders are shared in Drive:\n\n- If an author shares a document, the activity history for the document is visible to not only the creator, but also to the authenticated users with whom it was shared.\n- If a document was shared with a user and then made private, the authenticated user can see all activity history while they had access and that the permissions are now restricted.\n- If a document was never shared with a user, the user can't see any activity history.\n\nGet started\n-----------\n\nTo get the most out of the Drive Activity API, integrate your app with the\n[Google Drive API](/workspace/drive/api) first. To get started with the Drive Activity API,\nlearn how to [create a project](/workspace/drive/activity/v2/guides/project) and\n[authorize requests](/workspace/guides/configure-oauth-consent). Or, dive right in and read\nabout activities in the\n[API reference](/workspace/drive/activity/v2/reference/rest/v2/activity)."]]