This guide explains the differences between the v1 and v2 API versions and how to change your v1 application to support v2.
The v1 API used the scope:
The v2 API requires one of the following scopes:
In the v1 API, identifiers for objects like Drive items and users were opaque strings. In the v2 API, these objects are typically referenced using resource names; see the Cloud API Design Guide for more information.
These identifiers can generally be converted. For example, Drive items in the v2
API are referenced using the resource name
The request format for v2 is largely similar to that of v1. Specifically, you
can still request activity for a Drive file or a Drive ancestor, though note
that you must format those request parameters as
resource names by prefixing them with
"Grouping" is now called "Consolidation", and the
parameters have been removed.
There are also new filtering options which allow you to constrain the types of activity data returned in the response.
In the v1 API, the returned activity contained a
User if the actor was a known
user, and optionally contained a top level field like
In the v2 API, a richer set of
Actor types is
user.knownUser is populated when the actor is a known user. If
your application needs detailed information about users, it can query this from
the People API by passing the
The v1 API
primaryEventType field roughly corresponds with the v2
In the v1 API, the type of activity and the data associated with that activity
were in separate fields. For example, if the
primaryEventType field contained
move, then apps would assume a top-level
move field would be
populated with the added and removed parents.
In the v2 API, these are no longer distinct; the
message has exactly one field set, and that field signifies the type of action
and contains the details associated with that action. For example, an
ActionDetail representing a Move would set only the
move field, and that field
would list the added and removed parents.
In the v1 API, targets were always Drive items.
In the v2 API, targets can be other types of objects in Google Drive. For
example, changes to a drive have a target type of
Drive. The root
folder of a shared drive is still returned (as a
DriveItem in the
root field), but it is not the immediate target of the activity. A
similar concept applies to a
parent field refers to the Drive item containing the target comment
In the v1 API, the style of response changed when a consolidation ("grouping")
strategy was set. Specifically, when consolidation was enabled, each activity
contained the constituent
singleEvents and a
combinedEvent that summarized
the common activity among those constituent events. When consolidation was
combinedEvent field contained the original unconsolidated event
for each activity. Any of these events could, by itself, represent more than one
action, such as a create along with a share.
In the v2 API, the style of response does not change based on the consolidation
strategy, as the returned
always contains the full set of actors, targets, and actions.