EventLog.getEnterpriseEvents returns error
Hello
Calling EventLog.getEnterpriseEvents
with timeframe of (now - 2hrs) until (now) returns error 400 (bad_request):
created_before is beyond one year in the past, API only supports time range starting from one year in the past from now
I'm using the Java SDK and am autenticated properly, with all the possible permissions granted.
Please help
-
This seems to work...
long current = System.currentTimeMillis(); Date now = new Date(current); long before = current - 7200000; //2 hours before Date twoHoursAgo = new Date(before); EventLog events = EventLog.getEnterpriseEvents(api, twoHoursAgo, now); for (BoxEvent event : events) { System.out.println(event.getType()); }
-
See my reply in this answer: http://stackoverflow.com/questions/41413991/box-java-sdk-eventlog-getenterpriseevents-returns-error
In short - there is a bug in the REST API where specifying times with +UTC times return an error.
Please sign in to leave a comment.
Comments
2 comments