Hi,
I am trying to log view history for a Gsuite account in Google sheets.
Here is my code:
function listViews() {
var userKey = 'all';
var applicationName = 'drive';
var optionalArgs = {
//maxResults: 100,
eventName: 'view',
doc_type: 'mp4'
};
var response = AdminReports.Activities.list(userKey, applicationName, optionalArgs);
var activities = response.items;
if (activities && activities.length > 0) {
for (i = 0; i < activities.length; i++) {
var activity = activities[i];
Logger.log('%s || %s || %s || %s', activity.id.time, activity.actor.email, activity.events[0].parameters[3], activity.events[0].parameters[4]);
}
} else {
Logger.log('No data found.');
}
}
This still returns all events e.g document, spreadsheet etc i.e. not just mp4.
Can anyone please help out how to set the parameter correctly in the API call.
Related Links:
https://developers.google.com/admin-sdk/reports/v1/reference/activities/listhttps://developers.google.com/admin-sdk/reports/v1/appendix/activity/drive?apix_params=%7B%22userKey%22%3A%22all%22%2C%22applicationName%22%3A%22drive%22%2C%22eventName%22%3A%22view%22%2C%22maxResults%22%3A10%7D#viewThanks.