Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
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" to get the list.
Currently I am getting "NaN/NaN/NaN" as last modified date for folders, the list is not in sorted order and size of file is not proper. And, I am also not able to open the folders.
I am using OAuthClientRequest and passing the json as
String requestJson = "{\"path\": \"\",\"recursive\": true,\"include_media_info\": true,\"include_deleted\": false,\"include_has_explicit_shared_members\": false}";
requestQ.setBody(String.valueOf(requestJson));
requestQ.addHeader("Content-Type", "application/json");
For response I am using :
OAuthClient clientResponse = new OAuthClient(new URLConnectionClient());
OAuthResourceResponse resourceResponse= clientResponse.resource(requestQ, OAuth.HttpMethod.POST, OAuthResourceResponse.class);
Please suggest me !
Hello,
Is there any updates regarding this subject ? if it's the case can you point me to the doc.
And thanks.
@BouzianeAmineLocalfr No, unfortunately I don't have an update on this feature request.
Thanks for replaying, so fast.
Seriously? Is it really not possible to get create/modify date/time for files and folders using the Dropbox API?
@Miros Modified time is available for files, but not folders. Created time is not available for either. You can find the full documentation on the different pieces of metadata that are available for different types in the documentation, such as for /2/files/get_metadata.
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.
@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? 🧐
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):
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.
I seems to be derived, indeed.
Hi there!
If you need more help you can view your support options (expected response time for a 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!