I am using the Java SDK to try and get a list of admin events for the previous day. Using my own account, a co-admin, I have completed step 1 of OAUTH and obtained an access token and refresh token. I attempt to retieve the events as follows:
EventLog events = EventLog.getEnterpriseEvents(apiConnection, startPosition, start.getTime(), end.getTime());
As you can see I am not after any specific event types so I haven't specified any however for information I have also tried passing RENAME and UPLOAD. The result of this call is an empty set. Looking at the documentation I noticed that to retrieve admin_logs I needed to be admin:
'This API call will only work with an auth token from an enterprise admin account.'.
I thought that as co-admin this would work but to be sure I obtained the access and refresh token for the main admin (ensuring they had 'editor' permissions on the folder that contains the files) however the result was the same, an empty set.
Next I inspected the URL generated for the call and attempted to process it manually using Postman, however I got the same result. I did notice that if I removed the param 'stream_type=admin_logs' from the URL I would get back a set of results for that user and as admin for all users so it appears that the issue I am having is specifically with the stream_type=admin_logs, either my request/settings/permissions are incorrect or there is an issue with the admin_logs API request?
Any advice welcomed.
Please sign in to leave a comment.