Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

femiorok's avatar
femiorok
Explorer | Level 3
3 years ago

Building filtered notification system (without webhooks) using filesListFolderContinue

I'm a dev building out an email notification system for a client. Initially, the intent was to use webhooks but 1) I didn't care to store a cursor for every single user 2) to reduce costs, I didn't want to have an API set up that would be constantly pinged by Dropbox on every single update

 

Currently, I'm storing a cursor in a database that we use to check for updates every 30 minutes. Once we get a list of file changes, we pass the information onto another lambda that sends out emails 

 

The issue lies in how we're filtering the notifications. Currently, we filter out each notification by checking the sharing_info.modified_by value. If that value is among the IDs belonging to our team, it's removed. 

 

However, it appears that value isn't specific enough. I'm not sure how/why, but my client was the last one who moved the file and they still received an email notification. Thus, my question is this: 

1) Is there a way to specifically view events that are file uploads only? 

2) Is the modified_by value inside the fileMetadata object the best way to check who last uploaded or edited a file? 

Please let me know if seeing my code is necessary for context.

1 Reply

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    3 years ago

    The filesListFolder[Continue] functionality is the only functionality to use to list and follow the changes in an account, if you need to support any account type. That functionality doesn't offer more specific event filtering though; it returns both new and updated files, as well as folders.

     

    If this is a team account though, you also have the option of using the teamLogGetEvents[Continue] functionality, which offers a detailed event log of changes in a team. Note that file events in particular are only available to certain team plans though. If that is available for the relevant team, you can use that to filter to specific types of events and get information about the account involved in an event.

     

    Otherwise, yes, checking sharing_info.modified_by is the right way to see which user last modified the file when using the filesListFolder[Continue] functionality.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

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, Facebook or Instagram.

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!