<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Find the last updated timestamp of a directory (that includes changes to any of the files in the directory - add/modify/delete) in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Find-the-last-updated-timestamp-of-a-directory-that-includes/m-p/166714#M6020</link>
    <description>&lt;P&gt;Challenge: Use Dropbox REST API to get the last updated timestamp of a directory (that includes changes to any of the files in the directory - add/modify/delete).&lt;BR /&gt;&lt;BR /&gt;1) I tried using the API v1 first:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; curl -XPOST &lt;A href="https://api.dropbox.com/1/delta" rel="nofollow noreferrer" target="_blank"&gt;https://api.dropbox.com/1/delta&lt;/A&gt; -H "Authorization:Bearer ********AuthorizationKey*********" --data "path_prefix=/toratoratora/reports"&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {"has_more": true, "cursor": "**********CURSOR**********", "entries": [["/toratoratora/reports", {"rev": "7e3633bc43", "thumb_exists": false, "path": "/toratoratora/reports", "is_dir": true, "icon": "folder_user", "read_only": false, "modifier": null, "bytes": 0, "modified": "Tue, 22 Dec 2015 23:43:54 +0000", "shared_folder": {"shared_folder_id": "1099510378", "is_team_only_shared_folder": false}, "size": "0 bytes", "root": "dropbox", "revision": 126}]], "reset": true}&lt;BR /&gt;&lt;BR /&gt;However, the timestamp returned above is NOT the last time a file in the directory was modified (add/modify/delete).&lt;BR /&gt;&lt;BR /&gt;2) So, I tried using the API v2:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; curl -X POST &lt;A href="https://api.dropboxapi.com/2/files/get_metadata" rel="nofollow noreferrer" target="_blank"&gt;https://api.dropboxapi.com/2/files/get_metadata&lt;/A&gt; \&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --header "Authorization: Bearer ********AuthorizationKey*********" \&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --header "Content-Type: application/json" \&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --data "{\"path\": \"/toratoratora/reports/file_name.xlsx\",\"include_media_info\": true}"&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {".tag": "folder", "name": "Reports", "path_lower": "/toratoratora/reports", "id": "id:******ID******", "shared_folder_id": "dbsfid:###dbsfid####", "sharing_info": {"read_only": false, "shared_folder_id": "dbsfid:****dbsfid****"}}&lt;BR /&gt;&lt;BR /&gt;Although I've specified "include_media_info" as TRUE, the timestamp values for "client_modified" &amp;amp; "server_modified" are NOT included in the result as the request is for a directory and NOT a file.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;3) No luck when I usedget_metada:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; curl -X POST &lt;A href="https://api.dropboxapi.com/2/files/get_metadata" rel="nofollow noreferrer" target="_blank"&gt;https://api.dropboxapi.com/2/files/get_metadata&lt;/A&gt; --header "Authorization: Bearer ********AuthorizationKey*********" --header "Content-Type: application/json" --data "{\"path\": \"/toratoratora/reports\", \"include_media_info\": true}"&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {".tag": "folder", "name": "Reports", "path_lower": "/toratoratora/reports", "id": "id:******ID******", "shared_folder_id": "dbsfid:###dbsfid####", "sharing_info": {"read_only": false, "shared_folder_id": "dbsfid:****dbsfid****"}}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;4) One thing that looks promising is "list_folder"&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; curl -X POST &lt;A href="https://api.dropboxapi.com/2/files/list_folder" rel="nofollow noreferrer" target="_blank"&gt;https://api.dropboxapi.com/2/files/list_folder&lt;/A&gt; \&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --header "Authorization: Bearer ********AuthorizationKey*********" \&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --header "Content-Type: application/json" \&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --data "{\"path\": \"/toratoratora/reports\",\"recursive\": false,\"include_media_info\": true,\"include_deleted\": true}"&lt;BR /&gt;&lt;BR /&gt;This lists all the individual files and their timestamps. However, since the timestamps are NOT returned for DELETED files, there's NO way to find when the file was deleted &amp;amp; hence the directory was last updated.&lt;BR /&gt;&lt;BR /&gt;Does anybody have a solution for this problem?&lt;BR /&gt;&lt;BR /&gt;Do the Python API (&lt;A href="https://www.dropbox.com/developers/documentation/python" rel="nofollow noreferrer" target="_blank"&gt;https://www.dropbox.com/developers/documentation/python&lt;/A&gt;) have better options?&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2019 09:36:23 GMT</pubDate>
    <dc:creator>TEK P.</dc:creator>
    <dc:date>2019-05-29T09:36:23Z</dc:date>
    <item>
      <title>Find the last updated timestamp of a directory (that includes changes to any of the files in the directory - add/modify/delete)</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Find-the-last-updated-timestamp-of-a-directory-that-includes/m-p/166714#M6020</link>
      <description>&lt;P&gt;Challenge: Use Dropbox REST API to get the last updated timestamp of a directory (that includes changes to any of the files in the directory - add/modify/delete).&lt;BR /&gt;&lt;BR /&gt;1) I tried using the API v1 first:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; curl -XPOST &lt;A href="https://api.dropbox.com/1/delta" rel="nofollow noreferrer" target="_blank"&gt;https://api.dropbox.com/1/delta&lt;/A&gt; -H "Authorization:Bearer ********AuthorizationKey*********" --data "path_prefix=/toratoratora/reports"&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {"has_more": true, "cursor": "**********CURSOR**********", "entries": [["/toratoratora/reports", {"rev": "7e3633bc43", "thumb_exists": false, "path": "/toratoratora/reports", "is_dir": true, "icon": "folder_user", "read_only": false, "modifier": null, "bytes": 0, "modified": "Tue, 22 Dec 2015 23:43:54 +0000", "shared_folder": {"shared_folder_id": "1099510378", "is_team_only_shared_folder": false}, "size": "0 bytes", "root": "dropbox", "revision": 126}]], "reset": true}&lt;BR /&gt;&lt;BR /&gt;However, the timestamp returned above is NOT the last time a file in the directory was modified (add/modify/delete).&lt;BR /&gt;&lt;BR /&gt;2) So, I tried using the API v2:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; curl -X POST &lt;A href="https://api.dropboxapi.com/2/files/get_metadata" rel="nofollow noreferrer" target="_blank"&gt;https://api.dropboxapi.com/2/files/get_metadata&lt;/A&gt; \&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --header "Authorization: Bearer ********AuthorizationKey*********" \&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --header "Content-Type: application/json" \&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --data "{\"path\": \"/toratoratora/reports/file_name.xlsx\",\"include_media_info\": true}"&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {".tag": "folder", "name": "Reports", "path_lower": "/toratoratora/reports", "id": "id:******ID******", "shared_folder_id": "dbsfid:###dbsfid####", "sharing_info": {"read_only": false, "shared_folder_id": "dbsfid:****dbsfid****"}}&lt;BR /&gt;&lt;BR /&gt;Although I've specified "include_media_info" as TRUE, the timestamp values for "client_modified" &amp;amp; "server_modified" are NOT included in the result as the request is for a directory and NOT a file.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;3) No luck when I usedget_metada:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; curl -X POST &lt;A href="https://api.dropboxapi.com/2/files/get_metadata" rel="nofollow noreferrer" target="_blank"&gt;https://api.dropboxapi.com/2/files/get_metadata&lt;/A&gt; --header "Authorization: Bearer ********AuthorizationKey*********" --header "Content-Type: application/json" --data "{\"path\": \"/toratoratora/reports\", \"include_media_info\": true}"&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {".tag": "folder", "name": "Reports", "path_lower": "/toratoratora/reports", "id": "id:******ID******", "shared_folder_id": "dbsfid:###dbsfid####", "sharing_info": {"read_only": false, "shared_folder_id": "dbsfid:****dbsfid****"}}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;4) One thing that looks promising is "list_folder"&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; curl -X POST &lt;A href="https://api.dropboxapi.com/2/files/list_folder" rel="nofollow noreferrer" target="_blank"&gt;https://api.dropboxapi.com/2/files/list_folder&lt;/A&gt; \&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --header "Authorization: Bearer ********AuthorizationKey*********" \&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --header "Content-Type: application/json" \&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; --data "{\"path\": \"/toratoratora/reports\",\"recursive\": false,\"include_media_info\": true,\"include_deleted\": true}"&lt;BR /&gt;&lt;BR /&gt;This lists all the individual files and their timestamps. However, since the timestamps are NOT returned for DELETED files, there's NO way to find when the file was deleted &amp;amp; hence the directory was last updated.&lt;BR /&gt;&lt;BR /&gt;Does anybody have a solution for this problem?&lt;BR /&gt;&lt;BR /&gt;Do the Python API (&lt;A href="https://www.dropbox.com/developers/documentation/python" rel="nofollow noreferrer" target="_blank"&gt;https://www.dropbox.com/developers/documentation/python&lt;/A&gt;) have better options?&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:36:23 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Find-the-last-updated-timestamp-of-a-directory-that-includes/m-p/166714#M6020</guid>
      <dc:creator>TEK P.</dc:creator>
      <dc:date>2019-05-29T09:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Find the last updated timestamp of a directory (that includes changes to any of the files in the directory - add/modify/delete)</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Find-the-last-updated-timestamp-of-a-directory-that-includes/m-p/166715#M6021</link>
      <description>&lt;P&gt;[Cross-linking for reference:&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/35072308/dropbox-api-find-the-last-updated-timestamp-of-a-directory-that-includes-chang" rel="nofollow noreferrer"&gt;https://stackoverflow.com/questions/35072308/dropbox-api-find-the-last-updated-timestamp-of-a-directory-that-includes-chang&lt;/A&gt; ]&lt;/P&gt;
&lt;P&gt;The API (v1 or v2) doesn't currently return a modified time for folders that reflects changes inside that folder. I'll send this along as a feature request though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For reference "include_media_info" on &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#files-get_metadata" target="_blank" rel="nofollow noreferrer"&gt;/files/get_metadata&lt;/A&gt; is documented as:&lt;/P&gt;
&lt;P&gt;"If true, FileMetadata.media_info is set for photo and video. The default for this field is False."&lt;/P&gt;
&lt;P&gt;That being the case, that parameter shouldn't have any impact on&amp;nbsp;client_modified or&amp;nbsp;server_modified.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll also send along a feature request to include timestamps for deleted files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally, the Python SDK uses the same API you've been testing with, so there won't be any difference there.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2016 06:13:24 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Find-the-last-updated-timestamp-of-a-directory-that-includes/m-p/166715#M6021</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2016-01-29T06:13:24Z</dc:date>
    </item>
  </channel>
</rss>

