<?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 Iterating and Downloading from shared link subfolders in Discuss Dropbox Developer &amp; API</title>
    <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Iterating-and-Downloading-from-shared-link-subfolders/m-p/368500#M779</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I have a shared link looking like this:&amp;nbsp;&lt;A href="https://www.dropbox.com/sh/o0qb" target="_blank" rel="noopener"&gt;https://www.dropbox.com/sh/o0qb&lt;/A&gt;...&lt;/P&gt;
&lt;P&gt;In this link I have folders and subfolder and some heavy files in them.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I searched across the web and didn't find anything that could help me.&lt;/P&gt;
&lt;P&gt;I basically want to be able to iterate over the folders and the subfolders and download files from specific subfolders.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am working with Python and the best I could do so far was retrieve the subfolders names and id's (by using &lt;A href="https://stackoverflow.com/questions/47984087/using-dropbox-api-v2-and-python-how-to-get-a-list-of-files-and-folders-present/47994198#47994198" target="_blank" rel="noopener"&gt;this&lt;/A&gt; theard )&lt;/P&gt;
&lt;P&gt;Do you have any idea how to tackle it?&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 02 Oct 2019 08:17:17 GMT</pubDate>
    <dc:creator>avieini</dc:creator>
    <dc:date>2019-10-02T08:17:17Z</dc:date>
    <item>
      <title>Iterating and Downloading from shared link subfolders</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Iterating-and-Downloading-from-shared-link-subfolders/m-p/368500#M779</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I have a shared link looking like this:&amp;nbsp;&lt;A href="https://www.dropbox.com/sh/o0qb" target="_blank" rel="noopener"&gt;https://www.dropbox.com/sh/o0qb&lt;/A&gt;...&lt;/P&gt;
&lt;P&gt;In this link I have folders and subfolder and some heavy files in them.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I searched across the web and didn't find anything that could help me.&lt;/P&gt;
&lt;P&gt;I basically want to be able to iterate over the folders and the subfolders and download files from specific subfolders.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am working with Python and the best I could do so far was retrieve the subfolders names and id's (by using &lt;A href="https://stackoverflow.com/questions/47984087/using-dropbox-api-v2-and-python-how-to-get-a-list-of-files-and-folders-present/47994198#47994198" target="_blank" rel="noopener"&gt;this&lt;/A&gt; theard )&lt;/P&gt;
&lt;P&gt;Do you have any idea how to tackle it?&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 08:17:17 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Iterating-and-Downloading-from-shared-link-subfolders/m-p/368500#M779</guid>
      <dc:creator>avieini</dc:creator>
      <dc:date>2019-10-02T08:17:17Z</dc:date>
    </item>
    <item>
      <title>Re: Iterating and Downloading from shared link subfolders</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Iterating-and-Downloading-from-shared-link-subfolders/m-p/368584#M780</link>
      <description>&lt;P&gt;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation" target="_self"&gt;Here's the HTTP documentation&lt;/A&gt; and &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/" target="_self"&gt;here's the Python documentation (see the dropbox.dropbox subpage)&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;For HTTP requests, the &lt;STRONG&gt;/download&lt;/STRONG&gt;, &lt;STRONG&gt;/get_shared_link_file&lt;/STRONG&gt;, and&amp;nbsp;&lt;STRONG&gt;/list_folders&lt;/STRONG&gt;&amp;nbsp;endpoints sound like they would be helpful.&lt;/P&gt;
&lt;P&gt;For the Python library, check out the &lt;STRONG&gt;files_download&lt;/STRONG&gt;,&amp;nbsp;&lt;STRONG&gt;files_download_to_file&lt;/STRONG&gt;, and&amp;nbsp;&lt;STRONG&gt;files_list_folder&lt;/STRONG&gt; functions.&lt;/P&gt;
&lt;P&gt;The dropbox API is very complex, so you'll need to read through the documentation to see what all is available.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Oct 2019 15:41:53 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Iterating-and-Downloading-from-shared-link-subfolders/m-p/368584#M780</guid>
      <dc:creator>Pikamander2</dc:creator>
      <dc:date>2019-10-02T15:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: Iterating and Downloading from shared link subfolders</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Iterating-and-Downloading-from-shared-link-subfolders/m-p/368606#M781</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1214143"&gt;@avieini&lt;/a&gt;&amp;nbsp;Yes, as Pikamander2 mentioned, there are some methods that can help with this, like &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox.Dropbox.files_list_folder" target="_self"&gt;files_list_folder&lt;/A&gt; from the thread you linked to, as well as&amp;nbsp;&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox.Dropbox.sharing_get_shared_link_file" target="_self"&gt;sharing_get_shared_link_file&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Here's a basic example of what using those may look like:&lt;/P&gt;
&lt;PRE&gt;import dropbox

ACCESS_TOKEN = "..."
url = "https://www.dropbox.com/sh/..."

dbx = dropbox.Dropbox(ACCESS_TOKEN)

shared_link = dropbox.files.SharedLink(url=url)
print(dbx.files_list_folder(path="", shared_link=shared_link))

filename = "..."
print(dbx.sharing_get_shared_link_file(url=url, path=filename))
&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Oct 2019 17:40:24 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Iterating-and-Downloading-from-shared-link-subfolders/m-p/368606#M781</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2019-10-02T17:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: Iterating and Downloading from shared link subfolders</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Iterating-and-Downloading-from-shared-link-subfolders/m-p/368733#M784</link>
      <description>&lt;P&gt;Hi Greg, thanks for your answer&lt;/P&gt;&lt;P&gt;The point that I get confused with is how do I (iteratively) acess the subfolders of the main folder ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;The files_list_folder method only gives me the names and the ids of those subfolders.&lt;/P&gt;&lt;P&gt;If I could "enter" each subfolder I would be able to downlaod it's files.&lt;/P&gt;&lt;P&gt;Hope now it's clearer.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Oct 2019 05:47:16 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Iterating-and-Downloading-from-shared-link-subfolders/m-p/368733#M784</guid>
      <dc:creator>avieini</dc:creator>
      <dc:date>2019-10-03T05:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: Iterating and Downloading from shared link subfolders</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Iterating-and-Downloading-from-shared-link-subfolders/m-p/368876#M786</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1214143"&gt;@avieini&lt;/a&gt;&amp;nbsp;While the 'files_list_folder' method does not support the native 'recursive' mode when listing from a shared link, you can iteratively list out the contents of the subfolders, by calling again with the relevant 'path' value(s). For example, say if I make the first call:&lt;/P&gt;
&lt;PRE&gt;print(dbx.files_list_folder(path="", shared_link=shared_link))&lt;/PRE&gt;
&lt;P&gt;If that shows me that there is a subfolder with a 'name' of 'another folder', for example, I can then call again to list that one, like:&lt;/P&gt;
&lt;PRE&gt;print(dbx.files_list_folder(path="/another folder", shared_link=shared_link))&lt;/PRE&gt;
&lt;P&gt;That will give the listing for that subfolder, and then likewise I can call 'sharing_get_shared_link_file' to download a file from inside that subfolder, like:&lt;/P&gt;
&lt;PRE&gt;print(dbx.sharing_get_shared_link_file(url=url, path="/another folder/test.txt"))&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Oct 2019 15:26:49 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Iterating-and-Downloading-from-shared-link-subfolders/m-p/368876#M786</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2019-10-03T15:26:49Z</dc:date>
    </item>
  </channel>
</rss>

