Requires authorization
Returns a list of activities visible to the current logged in user. Visible activities are determined by the visiblity settings of the object that was acted on, e.g. Drive files a user can see. An activity is a record of past events. Multiple events may be merged if they are similar. A request is scoped to activities from a given Google service using the source parameter. Try it now.
Request
HTTP request
GET https://www.googleapis.com/appsactivity/v1/activities
Parameters
Parameter name | Value | Description |
---|---|---|
Optional query parameters | ||
drive.ancestorId |
string |
Identifies the Drive folder containing the items for which to return activities. |
drive.fileId |
string |
Identifies the Drive item to return activities for. |
groupingStrategy |
string |
Indicates the strategy to use when grouping
singleEvents items in the associated
combinedEvent object.
Acceptable values are:
|
pageSize |
integer |
The maximum number of events to return on a page. The response includes a continuation token if there are more events. |
pageToken |
string |
A token to retrieve a specific page of results. |
source |
string |
The Google service from which to return activities.
Possible values of source are:
|
userId |
string |
Indicates the user to return activity for. Use the special value
me to indicate the currently authenticated user.
|
Authorization
This request requires authorization with the following scope (read more about authentication and authorization).
Scope |
---|
https://www.googleapis.com/auth/activity |
Request body
Do not supply a request body with this method.
Response
If successful, this method returns a response body with the following structure:
{ "activities": [ { "combinedEvent": { "user": { "name": string, "photo": { "url": string }, "permissionId": string, "isDeleted": boolean, "isMe": boolean }, "primaryEventType": string, "additionalEventTypes": [ string ], "eventTimeMillis": unsigned long, "target": { "id": string, "name": string, "mimeType": string }, "move": { "addedParents": [ { "id": string, "title": string, "isRoot": boolean } ], "removedParents": [ { "id": string, "title": string, "isRoot": boolean } ] }, "rename": { "oldTitle": string, "newTitle": string }, "permissionChanges": [ { "addedPermissions": [ { "role": string, "type": string, "name": string, "user": { "name": string, "photo": { "url": string }, "permissionId": string, "isDeleted": boolean, "isMe": boolean }, "withLink": boolean, "permissionId": string } ], "removedPermissions": [ { "role": string, "type": string, "name": string, "user": { "name": string, "photo": { "url": string }, "permissionId": string, "isDeleted": boolean, "isMe": boolean }, "withLink": boolean, "permissionId": string } ] } ], "fromUserDeletion": boolean }, "singleEvents": [ { "user": { "name": string, "photo": { "url": string }, "permissionId": string, "isDeleted": boolean, "isMe": boolean }, "primaryEventType": string, "additionalEventTypes": [ string ], "eventTimeMillis": unsigned long, "target": { "id": string, "name": string, "mimeType": string }, "move": { "addedParents": [ { "id": string, "title": string, "isRoot": boolean } ], "removedParents": [ { "id": string, "title": string, "isRoot": boolean } ] }, "rename": { "oldTitle": string, "newTitle": string }, "permissionChanges": [ { "addedPermissions": [ { "role": string, "type": string, "name": string, "user": { "name": string, "photo": { "url": string }, "permissionId": string, "isDeleted": boolean, "isMe": boolean }, "withLink": boolean, "permissionId": string } ], "removedPermissions": [ { "role": string, "type": string, "name": string, "user": { "name": string, "photo": { "url": string }, "permissionId": string, "isDeleted": boolean, "isMe": boolean }, "withLink": boolean, "permissionId": string } ] } ], "fromUserDeletion": boolean } ] } ], "nextPageToken": string }
Property name | Value | Description | Notes |
---|---|---|---|
activities[] |
list |
List of activities. | |
activities[].combinedEvent |
nested object |
The fields common to all of the singleEvents that make up the Activity . |
|
activities[].combinedEvent.user |
nested object |
Represents the user responsible for the event. | |
activities[].combinedEvent.user.name |
string |
The displayable name of the user. | |
activities[].combinedEvent.user.photo |
nested object |
The profile photo of the user. Not present if the user has no profile photo. | |
activities[].combinedEvent.user.photo.url |
string |
The URL of the photo. | |
activities[].combinedEvent.primaryEventType |
string |
The main type of event that occurred.
Acceptable values are:
|
|
activities[].combinedEvent.additionalEventTypes[] |
list |
Additional event types. Some events may have multiple types when multiple actions are part of a single event. For example, creating a document, renaming it, and sharing it may be part of a single file-creation event. | |
activities[].combinedEvent.eventTimeMillis |
unsigned long |
The time at which the event occurred formatted as Unix time in milliseconds. | |
activities[].combinedEvent.target |
nested object |
Information specific to the Target object modified by the event. |
|
activities[].combinedEvent.target.id |
string |
The ID of the target. For example, in Google Drive, this is the file or folder ID. | |
activities[].combinedEvent.target.name |
string |
The name of the target. For example, in Google Drive, this is the title of the file. | |
activities[].combinedEvent.target.mimeType |
string |
The MIME type of the target. | |
activities[].combinedEvent.move |
nested object |
Extra information for move type events, such as changes in an object's parents. |
|
activities[].combinedEvent.move.addedParents[] |
list |
The added parent(s). | |
activities[].combinedEvent.move.addedParents[].id |
string |
The parent's ID. | |
activities[].combinedEvent.move.addedParents[].title |
string |
The parent's title. | |
activities[].combinedEvent.move.removedParents[] |
list |
The removed parent(s). | |
activities[].combinedEvent.move.removedParents[].id |
string |
The parent's ID. | |
activities[].combinedEvent.move.removedParents[].title |
string |
The parent's title. | |
activities[].combinedEvent.rename |
nested object |
Extra information for rename type events, such as the old and new names. |
|
activities[].combinedEvent.rename.oldTitle |
string |
The old title. | |
activities[].combinedEvent.rename.newTitle |
string |
The new title. | |
activities[].combinedEvent.permissionChanges[] |
list |
Extra information for permissionChange type events, such as the user or group the new permission applies to. |
|
activities[].combinedEvent.permissionChanges[].addedPermissions[] |
list |
Lists all Permission objects added. |
|
activities[].combinedEvent.permissionChanges[].addedPermissions[].role |
string |
Indicates the Google Drive permissions role. The role determines a user's ability to read, write, or comment on the file.
Acceptable values are:
|
|
activities[].combinedEvent.permissionChanges[].addedPermissions[].type |
string |
Indicates how widely permissions are granted.
Acceptable values are:
|
|
activities[].combinedEvent.permissionChanges[].addedPermissions[].name |
string |
The name of the user or group the permission applies to. | |
activities[].combinedEvent.permissionChanges[].addedPermissions[].withLink |
boolean |
Whether the permission requires a link to the file. | |
activities[].combinedEvent.permissionChanges[].addedPermissions[].permissionId |
string |
The ID for this permission. Corresponds to the Drive API's permission ID returned as part of the Drive Permissions resource. | |
activities[].combinedEvent.permissionChanges[].removedPermissions[] |
list |
Lists all Permission objects removed. |
|
activities[].combinedEvent.permissionChanges[].removedPermissions[].role |
string |
Indicates the Google Drive permissions role. The role determines a user's ability to read, write, or comment on the file.
Acceptable values are:
|
|
activities[].combinedEvent.permissionChanges[].removedPermissions[].type |
string |
Indicates how widely permissions are granted.
Acceptable values are:
|
|
activities[].combinedEvent.permissionChanges[].removedPermissions[].name |
string |
The name of the user or group the permission applies to. | |
activities[].combinedEvent.permissionChanges[].removedPermissions[].withLink |
boolean |
Whether the permission requires a link to the file. | |
activities[].combinedEvent.permissionChanges[].removedPermissions[].permissionId |
string |
The ID for this permission. Corresponds to the Drive API's permission ID returned as part of the Drive Permissions resource. | |
activities[].combinedEvent.fromUserDeletion |
boolean |
Whether this event is caused by a user being deleted. | |
activities[].singleEvents[] |
list |
A list of all the Events that make up the Activity . |
|
activities[].singleEvents[].user |
nested object |
Represents the user responsible for the event. | |
activities[].singleEvents[].user.name |
string |
The displayable name of the user. | |
activities[].singleEvents[].user.photo |
nested object |
The profile photo of the user. Not present if the user has no profile photo. | |
activities[].singleEvents[].user.photo.url |
string |
The URL of the photo. | |
activities[].singleEvents[].primaryEventType |
string |
The main type of event that occurred.
Acceptable values are:
|
|
activities[].singleEvents[].additionalEventTypes[] |
list |
Additional event types. Some events may have multiple types when multiple actions are part of a single event. For example, creating a document, renaming it, and sharing it may be part of a single file-creation event. | |
activities[].singleEvents[].eventTimeMillis |
unsigned long |
The time at which the event occurred formatted as Unix time in milliseconds. | |
activities[].singleEvents[].target |
nested object |
Information specific to the Target object modified by the event. |
|
activities[].singleEvents[].target.id |
string |
The ID of the target. For example, in Google Drive, this is the file or folder ID. | |
activities[].singleEvents[].target.name |
string |
The name of the target. For example, in Google Drive, this is the title of the file. | |
activities[].singleEvents[].target.mimeType |
string |
The MIME type of the target. | |
activities[].singleEvents[].move |
nested object |
Extra information for move type events, such as changes in an object's parents. |
|
activities[].singleEvents[].move.addedParents[] |
list |
The added parent(s). | |
activities[].singleEvents[].move.addedParents[].id |
string |
The parent's ID. | |
activities[].singleEvents[].move.addedParents[].title |
string |
The parent's title. | |
activities[].singleEvents[].move.removedParents[] |
list |
The removed parent(s). | |
activities[].singleEvents[].move.removedParents[].id |
string |
The parent's ID. | |
activities[].singleEvents[].move.removedParents[].title |
string |
The parent's title. | |
activities[].singleEvents[].rename |
nested object |
Extra information for rename type events, such as the old and new names. |
|
activities[].singleEvents[].rename.oldTitle |
string |
The old title. | |
activities[].singleEvents[].rename.newTitle |
string |
The new title. | |
activities[].singleEvents[].permissionChanges[] |
list |
Extra information for permissionChange type events, such as the user or group the new permission applies to. |
|
activities[].singleEvents[].permissionChanges[].addedPermissions[] |
list |
Lists all Permission objects added. |
|
activities[].singleEvents[].permissionChanges[].addedPermissions[].role |
string |
Indicates the Google Drive permissions role. The role determines a user's ability to read, write, or comment on the file.
Acceptable values are:
|
|
activities[].singleEvents[].permissionChanges[].addedPermissions[].type |
string |
Indicates how widely permissions are granted.
Acceptable values are:
|
|
activities[].singleEvents[].permissionChanges[].addedPermissions[].name |
string |
The name of the user or group the permission applies to. | |
activities[].singleEvents[].permissionChanges[].addedPermissions[].withLink |
boolean |
Whether the permission requires a link to the file. | |
activities[].singleEvents[].permissionChanges[].addedPermissions[].permissionId |
string |
The ID for this permission. Corresponds to the Drive API's permission ID returned as part of the Drive Permissions resource. | |
activities[].singleEvents[].permissionChanges[].removedPermissions[] |
list |
Lists all Permission objects removed. |
|
activities[].singleEvents[].permissionChanges[].removedPermissions[].role |
string |
Indicates the Google Drive permissions role. The role determines a user's ability to read, write, or comment on the file.
Acceptable values are:
|
|
activities[].singleEvents[].permissionChanges[].removedPermissions[].type |
string |
Indicates how widely permissions are granted.
Acceptable values are:
|
|
activities[].singleEvents[].permissionChanges[].removedPermissions[].name |
string |
The name of the user or group the permission applies to. | |
activities[].singleEvents[].permissionChanges[].removedPermissions[].withLink |
boolean |
Whether the permission requires a link to the file. | |
activities[].singleEvents[].permissionChanges[].removedPermissions[].permissionId |
string |
The ID for this permission. Corresponds to the Drive API's permission ID returned as part of the Drive Permissions resource. | |
activities[].singleEvents[].fromUserDeletion |
boolean |
Whether this event is caused by a user being deleted. | |
nextPageToken |
string |
Token for the next page of results. | |
activities[].combinedEvent.move.addedParents[].isRoot |
boolean |
Whether this is the root folder. | |
activities[].combinedEvent.move.removedParents[].isRoot |
boolean |
Whether this is the root folder. | |
activities[].combinedEvent.permissionChanges[].addedPermissions[].user |
nested object |
The user's information if the type is USER . |
|
activities[].combinedEvent.permissionChanges[].addedPermissions[].user.name |
string |
The displayable name of the user. | |
activities[].combinedEvent.permissionChanges[].addedPermissions[].user.photo |
nested object |
The profile photo of the user. Not present if the user has no profile photo. | |
activities[].combinedEvent.permissionChanges[].addedPermissions[].user.photo.url |
string |
The URL of the photo. | |
activities[].combinedEvent.permissionChanges[].removedPermissions[].user |
nested object |
The user's information if the type is USER . |
|
activities[].combinedEvent.permissionChanges[].removedPermissions[].user.name |
string |
The displayable name of the user. | |
activities[].combinedEvent.permissionChanges[].removedPermissions[].user.photo |
nested object |
The profile photo of the user. Not present if the user has no profile photo. | |
activities[].combinedEvent.permissionChanges[].removedPermissions[].user.photo.url |
string |
The URL of the photo. | |
activities[].singleEvents[].move.addedParents[].isRoot |
boolean |
Whether this is the root folder. | |
activities[].singleEvents[].move.removedParents[].isRoot |
boolean |
Whether this is the root folder. | |
activities[].singleEvents[].permissionChanges[].addedPermissions[].user |
nested object |
The user's information if the type is USER . |
|
activities[].singleEvents[].permissionChanges[].addedPermissions[].user.name |
string |
The displayable name of the user. | |
activities[].singleEvents[].permissionChanges[].addedPermissions[].user.photo |
nested object |
The profile photo of the user. Not present if the user has no profile photo. | |
activities[].singleEvents[].permissionChanges[].addedPermissions[].user.photo.url |
string |
The URL of the photo. | |
activities[].singleEvents[].permissionChanges[].removedPermissions[].user |
nested object |
The user's information if the type is USER . |
|
activities[].singleEvents[].permissionChanges[].removedPermissions[].user.name |
string |
The displayable name of the user. | |
activities[].singleEvents[].permissionChanges[].removedPermissions[].user.photo |
nested object |
The profile photo of the user. Not present if the user has no profile photo. | |
activities[].singleEvents[].permissionChanges[].removedPermissions[].user.photo.url |
string |
The URL of the photo. | |
activities[].combinedEvent.user.permissionId |
string |
The permission ID associated with this user. Equivalent to the Drive API's permission ID for this user, returned as part of the Drive Permissions resource. | |
activities[].combinedEvent.user.isDeleted |
boolean |
A boolean which indicates whether the specified User was deleted. If true, name , photo and permission_id will be omitted. |
|
activities[].combinedEvent.user.isMe |
boolean |
Whether the user is the authenticated user. | |
activities[].combinedEvent.permissionChanges[].addedPermissions[].user.permissionId |
string |
The permission ID associated with this user. Equivalent to the Drive API's permission ID for this user, returned as part of the Drive Permissions resource. | |
activities[].combinedEvent.permissionChanges[].addedPermissions[].user.isDeleted |
boolean |
A boolean which indicates whether the specified User was deleted. If true, name , photo and permission_id will be omitted. |
|
activities[].combinedEvent.permissionChanges[].addedPermissions[].user.isMe |
boolean |
Whether the user is the authenticated user. | |
activities[].combinedEvent.permissionChanges[].removedPermissions[].user.permissionId |
string |
The permission ID associated with this user. Equivalent to the Drive API's permission ID for this user, returned as part of the Drive Permissions resource. | |
activities[].combinedEvent.permissionChanges[].removedPermissions[].user.isDeleted |
boolean |
A boolean which indicates whether the specified User was deleted. If true, name , photo and permission_id will be omitted. |
|
activities[].combinedEvent.permissionChanges[].removedPermissions[].user.isMe |
boolean |
Whether the user is the authenticated user. | |
activities[].singleEvents[].user.permissionId |
string |
The permission ID associated with this user. Equivalent to the Drive API's permission ID for this user, returned as part of the Drive Permissions resource. | |
activities[].singleEvents[].user.isDeleted |
boolean |
A boolean which indicates whether the specified User was deleted. If true, name , photo and permission_id will be omitted. |
|
activities[].singleEvents[].user.isMe |
boolean |
Whether the user is the authenticated user. | |
activities[].singleEvents[].permissionChanges[].addedPermissions[].user.permissionId |
string |
The permission ID associated with this user. Equivalent to the Drive API's permission ID for this user, returned as part of the Drive Permissions resource. | |
activities[].singleEvents[].permissionChanges[].addedPermissions[].user.isDeleted |
boolean |
A boolean which indicates whether the specified User was deleted. If true, name , photo and permission_id will be omitted. |
|
activities[].singleEvents[].permissionChanges[].addedPermissions[].user.isMe |
boolean |
Whether the user is the authenticated user. | |
activities[].singleEvents[].permissionChanges[].removedPermissions[].user.permissionId |
string |
The permission ID associated with this user. Equivalent to the Drive API's permission ID for this user, returned as part of the Drive Permissions resource. | |
activities[].singleEvents[].permissionChanges[].removedPermissions[].user.isDeleted |
boolean |
A boolean which indicates whether the specified User was deleted. If true, name , photo and permission_id will be omitted. |
|
activities[].singleEvents[].permissionChanges[].removedPermissions[].user.isMe |
boolean |
Whether the user is the authenticated user. |
Try it!
Use the APIs Explorer below to call this method on live data and see the response.