cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Confirmation of audit log

Confirmation of audit log

J_Matsumoto
Explorer | Level 4
Go to solution

I'd like to check the audit log using python module.

 

TEAM_AUDIT_TOKEN = 'xxxxxxx'
dbx_team = dropbox.DropboxTeam(TEAM_AUDIT_TOKEN)
dbx_user = dbx_team.as_user("dbmid:xxxxxx")
end_time = dt.datetime.now()
start_time = end_time - dt.timedelta(hours=2)
check_times = dropbox.team_common.TimeRange(start_time,end_time)
res = dbx_user.team_log_get_events(
limit=None,
account_id=None,
time=check_times,
category=dropbox.team_log.EventCategory.logins)



It's possible to acquire below.

GetTeamEventsResult(events=None, cursor='xxxxxxxxxxxxxx, has_more=False)

I want you to tell me how log can be acquired after this.

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

It looks like the issue is the timezone that datetime.now is using by default. When interacting with the API, you should use UTC. So, instead of:

 

end_time = dt.datetime.now()

 

you can use:

 

end_time = dt.datetime.utcnow()

 

View solution in original post

4 Replies 4

J_Matsumoto
Explorer | Level 4
Go to solution

Is time of the log record late for 24 hours?


start_time = end_time - dt.timedelta(hours=33)

 

(24 hours before, +JST-9:00)

 

If it was changed, it could be acquired.

Greg-DB
Dropbox Staff
Go to solution

It looks like the issue is the timezone that datetime.now is using by default. When interacting with the API, you should use UTC. So, instead of:

 

end_time = dt.datetime.now()

 

you can use:

 

end_time = dt.datetime.utcnow()

 

J_Matsumoto
Explorer | Level 4
Go to solution

Greg

 

I'm very thankful.

Can the present designation audit log be acquired only after 24 hours?

Greg-DB
Dropbox Staff
Go to solution
I'm not sure I understand your question. Can you elaborate? There shouldn't be any significant delay on the audit log, and you can request it whenever you want, for whatever time range you want.
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    J_Matsumoto Explorer | Level 4
What do Dropbox user levels mean?