Trying to pick files modified in the last 24 hours
Hi,
I am trying to integrate Box with a Mule project. I need to pick all files that I have been modified in the last 24 hours. I looked into the Java SDK and found out that Box has a "Search" operation which takes a query string. But I am not sure about the query format in which I am supposed to pass the parameters. I did try the format mentioned in the below link-
https://docs.box.com/reference#searching-for-content
Please suggest the format in which the query is supposed to be sent for the Search operation. Or is their another way to pick files that have been modified in the last 24 hours? Please help.
Thanks.
-
I tried this using the java sdk
long current = System.currentTimeMillis(); Date now = new Date(current); long before = current - 86400000 ; //24 hours before Date dayBefore = new Date(before); EventLog events = EventLog.getEnterpriseEvents(api, dayBefore, now, BoxEvent.Type.EDIT); for (BoxEvent event : events) { System.out.println(event.getType() + " " + event.getSourceJSON().get("item_name") + " " + event.getCreatedAt() + " " + event.getCreatedBy().getLogin()); }
Please sign in to leave a comment.
Comments
1 comment