Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
nskobov
8 years agoExplorer | Level 4
How to Implement an exhaustive notification system with API V2
I am tasked with building an email notification system for my company which will alert our employees whenever a file is changed, moved, deleted, created, etc. I have properly set up webhooks with...
- 8 years ago
The Dropbox API doesn't directly return a few of these pieces of information unfortunately, such as file ID in DeleteMetadata, modified/deleted time in FolderMetadata/DeletedMetadata, or modified_by for FolderMetadata, but I'll pass these along as feature requests.
There are some other things you can do though. You can store the last known (File|Folder)Metadata object for a particular path and id, so that when you get a DeletedMetadata, you can check what the last known file ID was for that path.
You can check who is the owner, and that access level other members have, for any particular folder using /2/sharing/list_folder_members[/continue].
Additionally, for Business apps, you can use /2/team_log/get_events to get a log of events for all members.
Also, when members are invited to a shared folder, that doesn't automatically add the folder to their accounts, so it won't trigger a webhook. They will receive notifications of the invite directly from Dropbox itself anyway though. (You will then receive webhooks when they do accept the invite and add the folder to their accounts.)
Greg-DB
Dropbox Community Moderator
8 years agoThe Dropbox API doesn't directly return a few of these pieces of information unfortunately, such as file ID in DeleteMetadata, modified/deleted time in FolderMetadata/DeletedMetadata, or modified_by for FolderMetadata, but I'll pass these along as feature requests.
There are some other things you can do though. You can store the last known (File|Folder)Metadata object for a particular path and id, so that when you get a DeletedMetadata, you can check what the last known file ID was for that path.
You can check who is the owner, and that access level other members have, for any particular folder using /2/sharing/list_folder_members[/continue].
Additionally, for Business apps, you can use /2/team_log/get_events to get a log of events for all members.
Also, when members are invited to a shared folder, that doesn't automatically add the folder to their accounts, so it won't trigger a webhook. They will receive notifications of the invite directly from Dropbox itself anyway though. (You will then receive webhooks when they do accept the invite and add the folder to their accounts.)
nskobov
8 years agoExplorer | Level 4
Sorry I marked the post as answered, but I actually have an additional question regarding the team log get events call.
I've tried using that call, and I get back a lot of potentially useful information, but it gives me the team log starting with the creation of the team which was several months ago, I then recursively call team log get events continue with the previous cursor, to try to go through the entire events log to try to get the most recent events, but after several minutes this crashes my program because I'm guessing its just so much data.
Is there any way to get the most recent event cursor, or better yet, get an event log for a specific person?
- Greg-DB8 years ago
Dropbox Community Moderator
You can specify a particular time range, and/or a particular member, via the `time` and `account_id` parameters, respectively. You can find more information on those in the documentation:
https://www.dropbox.com/developers/documentation/http/teams#team_log-get_events
The API v2 Explorer may be helpful for building/testing these queries:
https://dropbox.github.io/dropbox-api-v2-explorer/team/#team_log_get_events
About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
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!