<?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 Not able to get team folders or files using python sdk in Discuss Dropbox Developer &amp; API</title>
    <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/391999#M958</link>
    <description>&lt;P&gt;Python SDK,&lt;BR /&gt;Not Able to get files and folders&amp;nbsp;&lt;BR /&gt;where I'm using dropbox business API access token&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;output = dbx.DropboxTeam(_dropbox_token).as_admin(ng_member_id).files_list_folder(&lt;SPAN&gt;""&lt;/SPAN&gt;).entries&lt;BR /&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;(output)&lt;/PRE&gt;
&lt;P&gt;Trying this as suggested from the doc.&lt;BR /&gt;help me to do it&amp;nbsp;&lt;BR /&gt;Trying to get files from a folder of folders and download the files.&lt;/P&gt;</description>
    <pubDate>Fri, 24 Jan 2020 14:52:49 GMT</pubDate>
    <dc:creator>GopalN</dc:creator>
    <dc:date>2020-01-24T14:52:49Z</dc:date>
    <item>
      <title>Not able to get team folders or files using python sdk</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/391999#M958</link>
      <description>&lt;P&gt;Python SDK,&lt;BR /&gt;Not Able to get files and folders&amp;nbsp;&lt;BR /&gt;where I'm using dropbox business API access token&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;output = dbx.DropboxTeam(_dropbox_token).as_admin(ng_member_id).files_list_folder(&lt;SPAN&gt;""&lt;/SPAN&gt;).entries&lt;BR /&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;(output)&lt;/PRE&gt;
&lt;P&gt;Trying this as suggested from the doc.&lt;BR /&gt;help me to do it&amp;nbsp;&lt;BR /&gt;Trying to get files from a folder of folders and download the files.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 14:52:49 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/391999#M958</guid>
      <dc:creator>GopalN</dc:creator>
      <dc:date>2020-01-24T14:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to get team folders or files using python sdk</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/392200#M961</link>
      <description>&lt;P&gt;[Cross-linking for reference:&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/59877833/download-files-from-dropbox-team-folder-using-python-sdk/59884229?noredirect=1#comment105910967_59884229" target="_blank"&gt;https://stackoverflow.com/questions/59877833/download-files-from-dropbox-team-folder-using-python-sdk/59884229?noredirect=1#comment105910967_59884229&lt;/A&gt;&amp;nbsp;]&lt;/P&gt;
&lt;P&gt;There are two things to note here that may be preventing you from listing everything you're expecting:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;The&amp;nbsp;&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; method isn't guaranteed to return everything in the requested folder. You need to always check the returned&amp;nbsp;&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/files.html#dropbox.files.ListFolderResult.has_more" target="_self"&gt;ListFolderResult.has_more&lt;/A&gt; value and if it's True, call back to&amp;nbsp;&lt;A href="http://files_list_folder_continue" target="_self"&gt;&lt;SPAN&gt;files_list_folder_continue&lt;/SPAN&gt;&lt;/A&gt; to get more results, as documented in &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox.Dropbox.files_list_folder" target="_self"&gt;the&amp;nbsp;files_list_folder documentation&lt;/A&gt;.&lt;/LI&gt;
&lt;LI&gt;Dropbox API calls operate in the team member folder by default. If you're on a team with the &lt;A href="https://help.dropbox.com/teams-admins/team-member/team-space-overview" target="_self"&gt;team space&lt;/A&gt; configuration, that won't include your team space folders. You can access the team space though, using&amp;nbsp;the 'Dropbox-API-Path-Root' header, as covered in &lt;A href="https://www.dropbox.com/developers/reference/namespace-guide" target="_self"&gt;the Namespace Guide&lt;/A&gt;. To set that in the Python SDK, you should use the&amp;nbsp;&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox.DropboxTeam.with_path_root" target="_self"&gt;with_path_root&lt;/A&gt; method. Your 'files_list_folder' code would then look something like:&amp;nbsp;
&lt;PRE&gt;output = dbx.DropboxTeam(_dropbox_token).with_path_root(dbx.common.PathRoot.root(team_space_namespace_id)).as_admin(ng_member_id).files_list_folder("").entries&lt;BR /&gt;print(output)&lt;/PRE&gt;
&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Fri, 24 Jan 2020 18:00:29 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/392200#M961</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-01-24T18:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to get team folders or files using python sdk</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/392518#M962</link>
      <description>&lt;P&gt;Thanks for the solution,&amp;nbsp;&lt;BR /&gt;I have tried the above code&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;dbx = dropbox.DropboxTeam(_dropbox_token).as_user(ng_member_id)
output = dbx.with_path_root(dropbox.common.PathRoot.root(_team_name_space_id)).files_list_folder("").entries
print(output)&lt;/PRE&gt;&lt;P&gt;Its giving me the error :&lt;/P&gt;&lt;P&gt;('8928caa6ce35a895296b45e5d694ddfe', 'Error in call to API function "files/list_folder": This API function operates on a single Dropbox account&lt;BR /&gt;t, but the OAuth 2 access token you provided is for an entire Dropbox Business team. Since your API app key has team member file access permissions, you can operate on a team member\'s Dropbox by providing the "Dropbox-API-Select-User" HTTP header or "select_user"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note:&amp;nbsp; I'm the admin and have Permission Type: Team Member file access in business API&lt;/P&gt;&lt;P&gt;Thanks for your solution.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 11:52:10 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/392518#M962</guid>
      <dc:creator>GopalN</dc:creator>
      <dc:date>2020-01-27T11:52:10Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to get team folders or files using python sdk</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/392671#M966</link>
      <description>&lt;P&gt;It looks like there's currently an issue with the Python SDK if you use 'as_user' or 'as_admin' before 'with_path_root'. I'll ask the team to fix that up.&lt;/P&gt;
&lt;P&gt;As a workaround, please use 'with_path_root' before&amp;nbsp;'as_user' or 'as_admin', as in the example in my previous comment.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 16:47:19 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/392671#M966</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-01-27T16:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to get team folders or files using python sdk</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/392684#M968</link>
      <description>&lt;P&gt;When I try to do with your reference code this exist with error&lt;/P&gt;&lt;P&gt;dropbox.exceptions.PathRootError: PathRootError('8255e7bee11bfaa054cc966323944b00', PathRootError('invalid_root', TeamRootInfo(root_namespace_id='5632093280', home_namespace_id='6821388560'&lt;BR /&gt;, home_path='/Gopal N')))&lt;BR /&gt;&lt;BR /&gt;please suggest the solution.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 17:14:13 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/392684#M968</guid>
      <dc:creator>GopalN</dc:creator>
      <dc:date>2020-01-27T17:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to get team folders or files using python sdk</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/392721#M969</link>
      <description>&lt;P&gt;What is the value of your '_team_name_space_id' variable?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on the error output you shared, if you want to list the contents of the team space, you should set your '_team_name_space_id' variable to "5632093280".&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 19:34:32 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/392721#M969</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-01-27T19:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to get team folders or files using python sdk</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/437726#M1384</link>
      <description>&lt;P&gt;For reference, the issue of not being able to use 'as_user' or 'as_admin' before 'with_path_root' should now be fixed as of v10.3.0 of the Dropbox Python SDK.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 19:37:09 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/437726#M1384</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-07-15T19:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to get team folders or files using python sdk</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/479473#M1646</link>
      <description>&lt;P&gt;In your code sample, you use the variable&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;team_space_namespace_id&lt;/PRE&gt;&lt;P&gt;but I don't know what that is.....where do I get the id of the Team Folder?&amp;nbsp; Is there a complete example of simply listing all the folders and files in a team folder using python?&lt;/P&gt;&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2020 04:10:12 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/479473#M1646</guid>
      <dc:creator>phermans</dc:creator>
      <dc:date>2020-12-15T04:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to get team folders or files using python sdk</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/479582#M1648</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1340790"&gt;@phermans&lt;/a&gt;&amp;nbsp;The 'team_space_namespace_id' for a team using the team space configuration would be the 'root_namespace_id' value, e.g., as returned by&amp;nbsp;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#users-get_current_account" target="_self"&gt;/2/users/get_current_account&lt;/A&gt;. I&amp;nbsp;recommend reviewing &lt;A href="https://www.dropbox.com/lp/developers/reference/dbx-team-files-guide" target="_self"&gt;the Team Files Guide&lt;/A&gt; for more context if you haven't already.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the Python SDK in particular, you can call that via&amp;nbsp;&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox.Dropbox.users_get_current_account" target="_self"&gt;users_get_current_account&lt;/A&gt;, so you can get that information from the returned&amp;nbsp;&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/users.html#dropbox.users.FullAccount.root_info" target="_self"&gt;FullAccount.root_info&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hopefully that should fill in the missing piece for you so you can connect that with the rest of the code and information in the earlier comments in this thread, but let us know if something still isn't working for you.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2020 14:56:11 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/479582#M1648</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-12-15T14:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to get team folders or files using python sdk</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/479612#M1649</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/10"&gt;@Greg-DB&lt;/a&gt;&amp;nbsp;Thanks for the quick reply. I know you are trying to be helpful but I have tried reading most of the guides, and find them to be mostly not helpful.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I jsut tried what you suggested, and what I could glean from the Python SDK...and it still won't work.&lt;/P&gt;&lt;PRE&gt;dbxt = dropbox.DropboxTeam(_dropbox_token).as_admin(_member_id)&lt;BR /&gt;full_accnt = dbxt.users_get_current_account()&lt;/PRE&gt;&lt;P&gt;yields an error that tells me little.....Error in call to API function "users/get_current_account": Invalid select user id format')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know what a "select user id format" is, or where it is documented but it must make sense to someone who wrote this stuff.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I looked at python sdk docs and find that it tells me this:&lt;/P&gt;&lt;PRE&gt;users_get_current_account()

Get information about the current user’s account.&lt;/PRE&gt;&lt;P&gt;Wonderful.....imagine that, a function called get users_get_current_account gets the current user's account! It apparently takes no arguments and it apparently doesn't work for some esoteric reason.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry for the rant, but this has already&amp;nbsp;cost hours of time to attempt to do the most basic thing - get a list of files and folders in the team folder.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will continue to guess and check until my token expires (yet again) and I waste a few more hours but after that I will probably say the hell with Dropbox API, it doesn't appear to be worth the time to learn it.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2020 16:09:13 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/479612#M1649</guid>
      <dc:creator>phermans</dc:creator>
      <dc:date>2020-12-15T16:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to get team folders or files using python sdk</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/479621#M1650</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1340790"&gt;@phermans&lt;/a&gt;&amp;nbsp;Thanks for the feedback!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I see you're currently getting the error:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Invalid select user id format&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That's referring to the value you're passing to identify the particular user account from the team to operate on, which in your case is via the &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox.DropboxTeam.as_admin" target="_blank"&gt;as_admin&lt;/A&gt; method to which you're supplying your variable '_member_id'. So, it appears your&lt;SPAN&gt;&amp;nbsp;'_member_id'&lt;/SPAN&gt; value is not valid. That value should be a "team member ID" (which starts with "dbmid:"). You can get the team member IDs from a number of places on the API, such as &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox.DropboxTeam.team_members_get_info" target="_blank" rel="noopener" data-nofollow="true"&gt;team_members_get_info&lt;/A&gt; and &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox.DropboxTeam.team_members_list" target="_blank"&gt;team_members_list&lt;/A&gt;/&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox.DropboxTeam.team_members_list_continue" target="_blank"&gt;team_members_list_continue&lt;/A&gt;. It's returned in the &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/team.html#dropbox.team.MemberProfile.team_member_id" target="_blank"&gt;TeamMemberProfile.team_member_id&lt;/A&gt; field.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, note that API calls for teams using the team space configuration default to the "team member folder", not the "team space". You can access the team space though by setting the relevant root. You can do so via the &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox.Dropbox.with_path_root" target="_blank" rel="noopener" data-nofollow="true"&gt;with_path_root&lt;/A&gt; method. (You mentioned reviewing some guides, but just in case you missed this one, &lt;A href="https://www.dropbox.com/lp/developers/reference/dbx-team-files-guide" target="_blank"&gt;the Team Files Guide&lt;/A&gt; would be the most relevant to this part.)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, putting that all together, it sounds like this is what you're looking to do:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;import dropbox

_dropbox_token = "&amp;lt;ACCESS_TOKEN&amp;gt;"
admin_email = "&amp;lt;EMAIL_ADDRESS&amp;gt;"

dbx_team = dropbox.DropboxTeam(_dropbox_token)

_member_id = dbx_team.team_members_get_info([dropbox.team.UserSelectorArg.email(admin_email)])[0].get_member_info().profile.team_member_id

dbx_admin = dbx_team.as_admin(_member_id)

root_namespace_id = dbx_admin.users_get_current_account().root_info.root_namespace_id

dbx_admin_team_root = dbx_admin.with_path_root(dropbox.common.PathRoot.root(root_namespace_id))

listing = dbx_admin_team_root.files_list_folder('')
for entry in listing.entries:
    print(entry.name)

while listing.has_more:
    listing = dbx_admin_team_root.files_list_folder_continue(listing.cursor)
    for entry in listing.entries:
        print(entry.name)&lt;/PRE&gt;
&lt;P&gt;Hope this helps!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2020 16:31:34 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/479621#M1650</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-12-15T16:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to get team folders or files using python sdk</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/479657#M1652</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/10"&gt;@Greg-DB&lt;/a&gt;&amp;nbsp;Thanks again! Yes it helped a lot. I accidentally forgot to include the dbmid: part......silly me.&amp;nbsp; I really appreciate your help. I will give it a go a bit later today and hopefully make more progress.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2020 18:14:25 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/479657#M1652</guid>
      <dc:creator>phermans</dc:creator>
      <dc:date>2020-12-15T18:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to get team folders or files using python sdk</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/480001#M1653</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/10"&gt;@Greg-DB&lt;/a&gt;&amp;nbsp;, I got that part working, but don't totally understand one part, hoping I missed it in the docs somewhere, or that there is a simple explanation.&amp;nbsp; In the code you posted, there was both a for loop and a while loop...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;for entry in listing.entries:
    print(entry.name)

while listing.has_more:
    listing = dbx_admin_team_root.files_list_folder_continue(listing.cursor)
    for entry in listing.entries:
        print(entry.name)&lt;/PRE&gt;&lt;P&gt;Not sure I understand why i need both of those. Seems like the initial for loop only gets some of the folders/files.....then the while keeps asking for more....but if that is correct, why even bother with the first for loop, why not just use the while listing.has_more loop?&amp;nbsp; Wouldn't that just keep going until all the files/folders were returned, and in this case, had their names printed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for clarifying.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2020 18:44:45 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/480001#M1653</guid>
      <dc:creator>phermans</dc:creator>
      <dc:date>2020-12-16T18:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to get team folders or files using python sdk</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/480014#M1655</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1340790"&gt;@phermans&lt;/a&gt;&amp;nbsp;In order to scale to folder listings of any size, the list_folder interface is paginated. The API may return the results across multiple pages, and each page can contain multiple files/folders. You need to implement calls to both&amp;nbsp;files_list_folder and&amp;nbsp;files_list_folder_continue to make sure you can&amp;nbsp;receive all of the entries.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The first for loop iterates over the results on the first page, from&amp;nbsp;files_list_folder; the while loop then has the app make additional calls to&amp;nbsp;files_list_folder_continue as needed, and the second for loop iterates over the results from those subsequent pages, if any, from&amp;nbsp;files_list_folder_continue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check out &lt;A href="http://files_list_folder" target="_self"&gt;the&amp;nbsp;files_list_folder documentation&lt;/A&gt; for more information on using this functionality.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2020 19:38:27 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/480014#M1655</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-12-16T19:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to get team folders or files using python sdk</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/624583#M2901</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;output &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; dropbox.DropboxTeam(TOKEN).with_path_root(dropbox.common.PathRoot.root(team_space_namespace_id)).as_admin(member_id).files_list_folder(&lt;/SPAN&gt;&lt;SPAN&gt;""&lt;/SPAN&gt;&lt;SPAN&gt;).entries&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;what is the team_space_namespace_id here? I use a 10-digit number&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "/home/mukesh/Documents/automation/app_test/dropbox/test_dropbox.py", line 20, in &amp;lt;module&amp;gt;&lt;BR /&gt;output = dropbox.DropboxTeam(TOKEN).with_path_root(dropbox.common.PathRoot.root(team_space_namespace_id)).as_admin(member_id).files_list_folder("").entries&lt;BR /&gt;File "/home/mukesh/Documents/BOVIWALK/projects/pose_estimation/boviwalk-ai/venv/lib/python3.10/site-packages/dropbox/base.py", line 2145, in files_list_folder&lt;BR /&gt;r = self.request(&lt;BR /&gt;File "/home/mukesh/Documents/BOVIWALK/projects/pose_estimation/boviwalk-ai/venv/lib/python3.10/site-packages/dropbox/dropbox_client.py", line 326, in request&lt;BR /&gt;res = self.request_json_string_with_retry(host,&lt;BR /&gt;File "/home/mukesh/Documents/BOVIWALK/projects/pose_estimation/boviwalk-ai/venv/lib/python3.10/site-packages/dropbox/dropbox_client.py", line 476, in request_json_string_with_retry&lt;BR /&gt;return self.request_json_string(host,&lt;BR /&gt;File "/home/mukesh/Documents/BOVIWALK/projects/pose_estimation/boviwalk-ai/venv/lib/python3.10/site-packages/dropbox/dropbox_client.py", line 596, in request_json_string&lt;BR /&gt;self.raise_dropbox_error_for_resp(r)&lt;BR /&gt;File "/home/mukesh/Documents/BOVIWALK/projects/pose_estimation/boviwalk-ai/venv/lib/python3.10/site-packages/dropbox/dropbox_client.py", line 643, in raise_dropbox_error_for_resp&lt;BR /&gt;raise PathRootError(request_id, err)&lt;BR /&gt;dropbox.exceptions.PathRootError: PathRootError('b0bc4fd1e82647deae8616b37255c2cc', PathRootError('invalid_root', TeamRootInfo(home_namespace&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 11:54:24 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/624583#M2901</guid>
      <dc:creator>mukesh111</dc:creator>
      <dc:date>2022-09-23T11:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to get team folders or files using python sdk</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/624607#M2902</link>
      <description>&lt;P&gt;Hi &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1576670"&gt;@mukesh111&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Take a look on Greg's post on this page top. There is pretty clear where 'team_space_namespace_id' comes from. Try reproduce something similar. &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@41457EF40051AFF130FDBFE21B496926/emoticons/1f609.png" alt=":winking_face:" title=":winking_face:" /&gt; One more thing, at present access token is 'short lived' only. If you need long term access, refresh token may be object of consideration from your side.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 13:12:33 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/624607#M2902</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2022-09-23T13:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to get team folders or files using python sdk</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/624639#M2903</link>
      <description>&lt;P&gt;Thanks for the reference it helped. I see that there are solutions to download files are recreate the whole structure and downloading them. Is there a single function that can handle downloading a complete directory&lt;/P&gt;&lt;P&gt;ex: I want to download a whole FolderA with (subfolder1, subfolder2, subfolder3)&lt;/P&gt;&lt;P&gt;I could only find the below for files is there for folders by any chance?:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;dbx_admin_team_root.files_download_to_file()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 23 Sep 2022 15:38:04 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/624639#M2903</guid>
      <dc:creator>mukesh111</dc:creator>
      <dc:date>2022-09-23T15:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to get team folders or files using python sdk</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/624646#M2904</link>
      <description>&lt;P&gt;Hi again &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1576670"&gt;@mukesh111&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You can download a folder as zip file. You can use the zip stream using &lt;A title="Download a folder from the user's Dropbox" href="https://github.com/dropbox/dropbox-sdk-python/blob/main/dropbox/base.py#L1462" target="_blank" rel="noopener"&gt;files_download_zip&lt;/A&gt; and unzip the content on fly or save it as file using &lt;A title="Download a folder from the user's Dropbox, as a zip file" href="https://github.com/dropbox/dropbox-sdk-python/blob/main/dropbox/base.py#L1498" target="_blank" rel="noopener"&gt;files_download_zip_to_file&lt;/A&gt;. &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@41457EF40051AFF130FDBFE21B496926/emoticons/1f609.png" alt=":winking_face:" title=":winking_face:" /&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 15:56:57 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Not-able-to-get-team-folders-or-files-using-python-sdk/m-p/624646#M2904</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2022-09-23T15:56:57Z</dc:date>
    </item>
  </channel>
</rss>

