We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Ankita W.
10 years agoNew member | Level 1
How to get last modified date for folders in Dropbox V2 API ?
Hi, I am trying migrate from v1 to v2 and get to the user's root folder and view all the list of files and folders with last modified date. I am passing "https://api.dropbox.com/2/files/list_folder"...
Greg-DB
Dropbox Community Moderator
10 years agoThe only workaround would be to use list_folder to list all of the contents of the folder and monitor for changes to them, recording the latest time as the modified time for the folder.
Diegovsky
4 years agoNew member | Level 2
Watching for changes isn't feasible if the user turns off their computer or loses connectivity. It seems that dropbox.com is able to show the last modified dates for folders so why isn't that exposed thorugh the V2 API?
Also, maintaining a live connection with dropbox would kinda suck since it would keep constantly polling for changes (which is expensive) and will consume a lot of band/API requests. What does the dev team recommend to solve this issue (that is: noticing server changes)? Is there a better way to know if there were any changes on the server?
My application is a oneshot app, which means it only compares disk changes and server changes once, synchronizes what has changed and then shuts off.
- Здравко4 years agoLegendary | Level 20
Diegovsky wrote:Watching for changes isn't feasible if the user turns off their computer or loses connectivity. ...
Also, maintaining a live connection with dropbox would kinda suck since it would keep constantly polling for changes (which is expensive) and will consume a lot of band/API requests. ... Is there a better way to know if there were any changes on the server?
My application is a oneshot app, which means it only compares disk changes and server changes once, synchronizes what has changed and then shuts off.
Hi Diegovsky,
In your case it's easy. You don't have to "keep constantly polling for changes". Just keep the last list cursor and whenever you want (i.e. you application runs next time) just try listing continuation. If the resulting list is empty,... no any changes. Just save the received cursor for next use and nothing more. If there are entries, they are last modified entries. Sync them, save received cursor for the next try and... it's ready. 😉
Hope this helps.
PS: By the way, there are no any timestamps for directory changes in dropbox.com. Where you have seen them? 🧐
- Diegovsky4 years agoNew member | Level 2
Indeed. I was using the python SDK so I didn't look much into this continuation API. Thanks for pointing me towards the right direction 👍
Regarding timestamps of folders, I just selected this folder and it shows me this info ("Modificado" meaning "modified" in english):
- Здравко4 years agoLegendary | Level 20
It's meaningless if you are using direct API calls or some SDK. You should be able access the same features anyhow (to the discussed context, at least).
Diegovsky wrote:...
Regarding timestamps of folders, I just selected this folder and it shows me this info ...
😁Don't mess you local folder properties with those available throughout Dropbox website! 😉 What's on your screenshot?! Is it dropbox.com content?! 🤔😜 Your local folder will always have properties like any other local folder (either in sync by hand or using Dropbox app). Those properties are not in sync (they are no object of sync)! Till some future moment when this will change.
Hope this clarifies matter.
Edit: Oh... Sorry! There really are such "Modified" labels. You can easy see that they are incorrect. Looks like those moments are derived calculations... anyway - unusable.
- Greg-DB4 years ago
Dropbox Community Moderator
Diegovsky Thanks for the feedback! For reference, not all of the functionality used in the Dropbox product itself is available via the API, but I'll pass this along to the team. In addition to Здравко's guidance, be sure to check out the File Access Guide and Detecting Changes Guide, if you haven't already.
About 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!