Cut the Clutter: Test Ignore Files Feature - sign up to become a beta tester here.
Forum Discussion
GevorgMel
5 years agoHelpful | Level 5
TeamEvent Sorting Order (GetEventsAsync)
Hello,
Can you please help me understand the Team Events sorting order returned by Dropbox API?
I found only this info:
I developed an .NET application, which reads Team Events using Dropbox .NET SDK methods GetEventsAsync and GetEventsContinueAsync. The application uses TimeRange parameter to pass date range for events to read. For eaxample, StartDate: 10-Sep-2020 and EndDate: 28-Sep-2020, on each method call I get the events list and start process them one by one until the HasMore flag is false. If something goes wrong during processing the current event, the application saves the last succesfully processed event and exit. On the application next run the saved last event is used to continue with remaining events. To make sure nothing will be missed, I need your help to find the best solution. Perhaps having knowledge how the events are sorted might help.
Please advise me what is the best way to achive this goal.
Thanks,
Gevorg
4 Replies
- Greg-DB5 years ago
Dropbox Community Moderator
There isn't any other guidance or guarantee on the sort order that I can offer beyond what's in the documentation. Rather than relying on timestamps though, we recommend using the latest returned 'cursor' value for a successfully processed batch of events when calling back to /2/team_log/get_events/continue as shown in the /2/team_log/get_events[/continue] GetTeamEventsResult documentation.
- GevorgMel5 years agoHelpful | Level 5
Thank you Greg for your quick reply,
One more question please, can you confirm that the events sorting is not changed regardless of Dropbox API calls and time range paramter? In which order the events were created in Dropbox data storage, they remained as it is.Thanks,
Gevorg
- Greg-DB5 years ago
Dropbox Community Moderator
Since there isn't documentation on that behavior of the events list specifically, I can't offer a guarantee. (I wouldn't want to make a promise and lead you astray if it might change in the future!) I recommend using the cursor as documented to make sure you don't miss events.
- GevorgMel5 years agoHelpful | Level 5
Hi Greg,
Not always a cursor could be used for the app second run, we have configurable time range parameter. So the time range can be changed before the next run, which means we need to call GetEventsAsync first with new paramters then continue GetEventsContinueAsync with cursor.
That is why I'm trying to get more details and know how for this task.
Thanks,
Gevorg
About Discuss Dropbox Developer & API
Make connections with other developers815 PostsLatest Activity: 4 years ago
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!