【发布时间】:2021-03-05 14:37:01
【问题描述】:
如何从 Reports API 获取 PREVIEW 和 PRINT 事件?
以下是文档链接:
-
PREVIEW- https://developers.google.com/admin-sdk/reports/v1/appendix/activity/drive#preview -
PRINT- https://developers.google.com/admin-sdk/reports/v1/appendix/activity/drive#print
关于PREVIEW,我注意到它只创建VIEW,即使我通过Web 应用程序以预览模式打开文件:Screenshot。所以不清楚什么时候应该触发PREVIEW。
关于PRINT,我用了两种方式:
- 快捷键Command+P
- 文件 -> 打印
没有任何效果,它不会创建
PRINT事件。
我正在使用googleapiclient (Python) 库来获取活动。这是一个代码:
client = build('admin', 'reports_v1', credentials=credentials)
response = client.activities().list(
userKey='all',
applicationName='drive',
maxResults=5,
eventName='print',
).execute()
此代码适用于获取其他事件,例如DOWNLOAD、EDIT 等。
但是对于PRINT 和PREVIEW,它总是返回没有事件的响应:
{'kind': 'admin#reports#activities', 'etag': '"SOME_ETAG"'}
【问题讨论】:
标签: google-admin-sdk