<?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 Re: Retrieve all files in App shared folder (respecting folder tree) in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Retrieve-all-files-in-App-shared-folder-respecting-folder-tree/m-p/345663#M19945</link>
    <description>&lt;P&gt;Thanks for following up and clarifying! I'm glad Taylor was able to help. Yes, to reconstruct the folder hiearachy like that, you'll want to split the path on "/".&lt;/P&gt;
&lt;P&gt;For reference, whenever you're going to display the path to the user, you should use the "path_display" value. Whenever you're using the path to make another API call though, it's best to use the "path_lower" value.&lt;/P&gt;</description>
    <pubDate>Tue, 21 May 2019 15:52:51 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2019-05-21T15:52:51Z</dc:date>
    <item>
      <title>Retrieve all files in App shared folder (respecting folder tree)</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Retrieve-all-files-in-App-shared-folder-respecting-folder-tree/m-p/345215#M19923</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I'd like to display all files of from a shared folder, using DropBox API respecting my folder hierachy. I followed 2 different ways :&lt;/P&gt;&lt;P&gt;1) My first idea was to use the&amp;nbsp;&lt;STRONG&gt;files/list_folder&amp;nbsp;&lt;/STRONG&gt;endpoint (and recursive parameter as true) then&amp;nbsp;&lt;STRONG&gt;files/list_folder/continue&lt;/STRONG&gt; as mentionned in lot of answers here to get all files and folders.&lt;/P&gt;&lt;P&gt;It works quite nice, but I get all files and folders regardless of the folders tree. And was not able to recreate the initial folder hierarchy by myself cause file doesn't contain his parent folder id.&lt;/P&gt;&lt;P&gt;2) Second idea. Get the list of the first level of folders using&amp;nbsp;&lt;STRONG&gt;files/list_folder&lt;/STRONG&gt;, then for each folder found, request the&amp;nbsp;&lt;STRONG&gt;files/list_folder&amp;nbsp;&lt;/STRONG&gt;endpoint again to get the list of folder files.&lt;/P&gt;&lt;P&gt;It works but it takes lot of time... I have got 15 folders and the all 16 requests (the root one and one for each folder) takes at least 6s !! (I use guzzle and PHP)&lt;/P&gt;&lt;P&gt;There is a way to know the id of direct parent folder ? (case 1)&lt;BR /&gt;Or a better way to retrieve files with better performance ?&amp;nbsp;(case 2)&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:06:22 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Retrieve-all-files-in-App-shared-folder-respecting-folder-tree/m-p/345215#M19923</guid>
      <dc:creator>sixdesign</dc:creator>
      <dc:date>2019-05-29T09:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve all files in App shared folder (respecting folder tree)</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Retrieve-all-files-in-App-shared-folder-respecting-folder-tree/m-p/345501#M19932</link>
      <description>&lt;P&gt;Hi! Happy to help. A couple clarifying questions:&lt;/P&gt;
&lt;P&gt;- Could you clarify what you mean by 'respecting folder heirarchy'?&amp;nbsp;&lt;BR /&gt;- What is the final way you want your files displayed?&lt;/P&gt;
&lt;P&gt;In general, your #1 solution is the better way to go. I reccommend continuing to iterate on that solution.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A response from a successful list_folder response will typically look like this:&amp;nbsp;&lt;/P&gt;
&lt;PRE class="last literal-block"&gt;{
    "entries": [
        {
            ".tag": "file",
            "name": "Prime_Numbers.txt",
            "id": "id:a4ayc_80_OEAAAAAAAAAXw",
            "client_modified": "2015-05-12T15:50:38Z",
            "server_modified": "2015-05-12T15:50:38Z",
            "rev": "a1c10ce0dd78",
            "size": 7212,
            "path_lower": "/homework/math/prime_numbers.txt",
            "path_display": "/Homework/math/Prime_Numbers.txt",
            "sharing_info": {
                "read_only": true,
                "parent_shared_folder_id": "84528192421",
                "modified_by": "dbid:AAH4f99T0taONIb-OurWxbNQ6ywGRopQngc"
            },
            "is_downloadable": true,
            "property_groups": [
                {
                    "template_id": "ptid:1a5n2i6d3OYEAAAAAAAAAYa",
                    "fields": [
                        {
                            "name": "Security Policy",
                            "value": "Confidential"
                        }
                    ]
                }
            ],
            "has_explicit_shared_members": false,
            "content_hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
        },&lt;BR /&gt;        // other entries&lt;BR /&gt;    ];&lt;/PRE&gt;
&lt;P&gt;The property named 'path_lower' (or path_display) contains the explicit path to your file. Those strings contain all the information about where your file lives in relation to your folder heirarchy.&lt;/P&gt;
&lt;P&gt;You can either parse the string manually (using a built-in method like `split('/')`) or bring in a module to help work with the path. In both cases you should be able to use the path information to handle your files according to that heirarchy.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2019 19:24:34 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Retrieve-all-files-in-App-shared-folder-respecting-folder-tree/m-p/345501#M19932</guid>
      <dc:creator>TaylorKrusen</dc:creator>
      <dc:date>2019-05-20T19:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve all files in App shared folder (respecting folder tree)</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Retrieve-all-files-in-App-shared-folder-respecting-folder-tree/m-p/345627#M19944</link>
      <description>&lt;P&gt;Hi! Thanks for the help!&lt;/P&gt;&lt;P&gt;You definitely right. Split the 'path_lower' will do the job to recreate the folder hierarchy.&lt;/P&gt;&lt;P&gt;By&amp;nbsp;&lt;SPAN&gt;'respecting folder hierarchy' I don't know how to explain ^^ but I'd like to display something like :&amp;nbsp;&lt;IMG src="https://zapier.cachefly.net/storage/photos/0de684eea65183af9bbbe0f54f9827b8.png" border="0" alt="" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you very much for your quick reply!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 14:36:20 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Retrieve-all-files-in-App-shared-folder-respecting-folder-tree/m-p/345627#M19944</guid>
      <dc:creator>sixdesign</dc:creator>
      <dc:date>2019-05-21T14:36:20Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve all files in App shared folder (respecting folder tree)</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Retrieve-all-files-in-App-shared-folder-respecting-folder-tree/m-p/345663#M19945</link>
      <description>&lt;P&gt;Thanks for following up and clarifying! I'm glad Taylor was able to help. Yes, to reconstruct the folder hiearachy like that, you'll want to split the path on "/".&lt;/P&gt;
&lt;P&gt;For reference, whenever you're going to display the path to the user, you should use the "path_display" value. Whenever you're using the path to make another API call though, it's best to use the "path_lower" value.&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 15:52:51 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Retrieve-all-files-in-App-shared-folder-respecting-folder-tree/m-p/345663#M19945</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2019-05-21T15:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve all files in App shared folder (respecting folder tree)</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Retrieve-all-files-in-App-shared-folder-respecting-folder-tree/m-p/345974#M19955</link>
      <description>&lt;P&gt;Thanks Greg K.&amp;nbsp;for that clarification. That makes sense for me using "path_lower" to request the API if needed. But good to know.&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 09:37:26 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Retrieve-all-files-in-App-shared-folder-respecting-folder-tree/m-p/345974#M19955</guid>
      <dc:creator>sixdesign</dc:creator>
      <dc:date>2019-05-23T09:37:26Z</dc:date>
    </item>
  </channel>
</rss>

