cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to get last modified date for folders in Dropbox V2 API ?

How to get last modified date for folders in Dropbox V2 API ?

Ankita W.
New member | Level 1

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 !
21 Replies 21

Здравко
Legendary | Level 20

@Greg-DB wrote:

... for files, but not folders. Created time is not available for either. ...


Hmm... 🤔 Not entirely true! It seems Dropbox (as system) keeps folders creation moment internally (I have no idea why). It's another thing that this creation time is not accessible using Dropbox API for the folders. 😉 Actually there is no creation time field in all API structures at all.

File creation moment and folder last change moment are unavailable in Dropbox at all (not only in API and SDK or I haven't seen any symptoms to something else at least).

Greg-DB
Dropbox Staff

@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.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Здравко Legendary | Level 20
  • User avatar
    Diegovsky New member | Level 2
What do Dropbox user levels mean?