Reputation: 9685
I've managed to get the Google Drive API to run against a Google doc in my personal drive (of a Corporate paid account) using their example (after correcting for Python 2 syntax).
However, it shows only edit
and comment
as primary actions in that history, I don't see any actions saying just view
.
Does that mean that there is no action recorded for document views? or that they are simply recorded as comment
or something else, since the document URL always seems to redirect to .../edit
even if I only grant View privileges.
Upvotes: 1
Views: 721
Reputation: 5963
There is no view
action detail in Drive Activity API.
edit
or comment
action detail cannot be used to get view
action history.
I tried to view a document and get all its activity and there is no new record seen (either view
, edit
or comment
).
If you want to get the view history of a document, here are some of your options:
viewedByMe
flag and viewedByMeTime
datetime parameter.It will only show the last time you viewed the file. If the file is shared, you cannot use this to get the recent datetime the file was viewed by other user.
Sample activities.list Request Parameters:
userKey: all
applicationName: drive
eventName: view
filters: doc_id==13NgKy87BggedOXnmkymygTyEh0xxxxxxxx
NOTE:
- If the file was viewed by a user outside your organization, the email address will not be available (User is anonymous)
- Drive audit logs has a data retention time of 6 months. You can access Drive audit logs data this far back.
References:
Upvotes: 2