<?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: Problem with listing team folder with python SDK:  Error in call to API function &amp;quot;files/lis in Discuss Dropbox Developer &amp; API</title>
    <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Problem-with-listing-team-folder-with-python-SDK-Error-in-call/m-p/611491#M2798</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1559004"&gt;@Tobiwan&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The subfolders get printed only to around 1500 and in a weird order. For the 1500 i probably have to use recusion again right but how do i activate it in that context? ...&lt;/SPAN&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Hi &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1559004"&gt;@Tobiwan&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Currently, in your code, you are using only &lt;A title="Starts returning the contents of a folder" href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox_client.Dropbox.files_list_folder" target="_blank" rel="noopener"&gt;files_list_folder&lt;/A&gt; method. This method starts content listing process and can fetch the list entirely if it's small enough, but you don't have to rely on! Within the &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/files.html#dropbox.files.ListFolderResult" target="_blank" rel="noopener"&gt;retrieved result&lt;/A&gt; is a field 'has_more' (i.e. are some entries lefts to be fetched). If there are, you have to continue listing using &lt;A title="Paginate through all files and retrieve updates to the folder" href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox_client.Dropbox.files_list_folder_continue" target="_blank" rel="noopener"&gt;files_list_folder_continue&lt;/A&gt; method until there are no more entries left. On every pagination step, cursor take place within result; a cursor which you have to use as argument on following call. In such a way you will no more be limited to entries number able to be got out from single call.&lt;/P&gt;&lt;P&gt;Recursion can be activated using the corresponding argument (the same named) in the initial listing step. &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; There are other parameters too that control the listing process; take a look there. Listing order can't get controlled; it's something internal, you shouldn't rely on.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
    <pubDate>Sat, 23 Jul 2022 12:09:14 GMT</pubDate>
    <dc:creator>Здравко</dc:creator>
    <dc:date>2022-07-23T12:09:14Z</dc:date>
    <item>
      <title>Problem with listing team folder with python SDK:  Error in call to API function "files/list_folder</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Problem-with-listing-team-folder-with-python-SDK-Error-in-call/m-p/611359#M2794</link>
      <description>&lt;P&gt;Hi Everyone!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First of all im new to this so please dont take me to harsh if im using wrong vocabulary or im saying dumb stuff haha &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@13532C4C3505179FBF012F1C117AE2EB/emoticons/1f604.png" alt=":grinning_face_with_smiling_eyes:" title=":grinning_face_with_smiling_eyes:" /&gt;&lt;/P&gt;
&lt;P&gt;So i have a big folder which contains 10.000 folders each containing again around 5 image files in my Team Directory. I want to create a download link for every file using the python sdk. I created an app and got my token. Then I got my,&amp;nbsp;&lt;SPAN&gt;team_space_namespace_id&lt;SPAN&gt; (&lt;FONT color="#008000"&gt;list_folders&lt;/FONT&gt;)&lt;/SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;ng_member_id (&lt;FONT color="#008000"&gt;get_current_account&lt;/FONT&gt;) with the green functions(?) in postman. Then i pasted them into this python script:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;import&lt;/SPAN&gt; &lt;SPAN&gt;dropbox&lt;/SPAN&gt; &lt;SPAN&gt;as&lt;/SPAN&gt; &lt;SPAN&gt;dbx&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;dropbox_token&lt;/SPAN&gt;&lt;SPAN&gt; = &amp;lt;access token&amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;team_space_namespace_id&lt;/SPAN&gt;&lt;SPAN&gt; =&amp;nbsp;&amp;lt;team_space_namespace_id&amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;ng_member_id&lt;/SPAN&gt;&lt;SPAN&gt; =&amp;nbsp;&amp;lt;ng_member_id &amp;gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;BR /&gt;
&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;output&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;dbx&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;DropboxTeam&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;dropbox_token&lt;/SPAN&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;SPAN&gt;with_path_root&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;dbx&lt;/SPAN&gt;&lt;SPAN&gt;.common.PathRoot.root(&lt;/SPAN&gt;&lt;SPAN&gt;team_space_namespace_id&lt;/SPAN&gt;&lt;SPAN&gt;)).as_admin(&lt;/SPAN&gt;&lt;SPAN&gt;ng_member_id&lt;/SPAN&gt;&lt;SPAN&gt;).files_list_folder(&lt;/SPAN&gt;&lt;SPAN&gt;""&lt;/SPAN&gt;&lt;SPAN&gt;).entries&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;output&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size="4"&gt;&lt;SPAN&gt;I got the "DropboxTeam" Line because when i list the noremal directory only my personal directory is shown but i wanted the Team Folder. When I Executed it i got the following error: &lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="lia-indent-padding-left-30px"&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;dropbox.exceptions.BadInputError: BadInputError('540abf5f823f4f699855a087034d2339', 'Error in call to API function "files/list_folder": Unexpected select user header. Your app does not have permission to use this feature')&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size="4"&gt;&lt;SPAN&gt;I couldnt find the files/list_folder permission in the app settings and there are all und "Files and Folders" and "Account Info" activated. So whats the problem here? Thank you for any help!&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size="4"&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;FONT size="4"&gt;&lt;SPAN&gt;Tobi&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 25 Jul 2022 21:14:54 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Problem-with-listing-team-folder-with-python-SDK-Error-in-call/m-p/611359#M2794</guid>
      <dc:creator>Tobiwan</dc:creator>
      <dc:date>2022-07-25T21:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with listing team folder with python SDK:  Error in call to API function "files/lis</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Problem-with-listing-team-folder-with-python-SDK-Error-in-call/m-p/611383#M2796</link>
      <description>&lt;P&gt;I see you're getting the error: "Unexpected select user header. Your app does not have permission to use this feature". This error indicates that you're supplying the "Dropbox-API-Select-User" or "Dropbox-API-Select-Admin" request header (via the 'as_user' or 'as_admin' method, respectively), but are using an access token for an app that does not have access to this feature. This is &lt;A href="https://www.dropbox.com/developers/documentation/http/teams#teams-member-file-access" rel="noreferrer" target="_blank"&gt;the "member file access" feature&lt;/A&gt;, meant for use by Dropbox Business API apps with the "team member file access" &lt;A href="https://www.dropbox.com/developers/documentation/http/teams#access-types" rel="noreferrer" target="_blank"&gt;permission&lt;/A&gt; or scoped apps with the 'team_data.member' scope, to enable an app to be connected to an entire team and operate on behalf of any team member.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you are just trying to interact with files/folders in your account though (even if they happen to be in a team folder), you don't need that functionality, so you can omit the '.as_admin(ng_member_id)' from your code and instead just do something like this:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;output = dbx.Dropbox(dropbox_token).with_path_root(dbx.common.PathRoot.root(team_space_namespace_id)).files_list_folder("").entries
print(output)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 19:33:44 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Problem-with-listing-team-folder-with-python-SDK-Error-in-call/m-p/611383#M2796</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-07-22T19:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with listing team folder with python SDK:  Error in call to API function "files/lis</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Problem-with-listing-team-folder-with-python-SDK-Error-in-call/m-p/611411#M2797</link>
      <description>&lt;P&gt;Ok really nice thank you! I had to change the team ID but then i could get the metadata from The Team folder! But How do i use the&lt;/P&gt;&lt;P&gt;"&lt;SPAN&gt;sharing_create_shared_link_with_settings" method in that context?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also when i use this code to display all directories in "baked textures) (the 10k folder folder :D):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;FONT size="2"&gt;for entry in dbx.Dropbox(dropbox_token).with_path_root(dbx.common.PathRoot.root(team_space_namespace_id)).files_list_folder("/Baked&amp;nbsp;Textures").entries:&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&lt;FONT size="2"&gt;print(entry.name)&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The subfolders get printed only to around 1500 and in a weird order. For the 1500 i probably have to use recusion again right but how do i activate it in that context? The order is for example:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;SPAN&gt;1038&lt;BR /&gt;1039&lt;BR /&gt;1040&lt;BR /&gt;1042&lt;BR /&gt;1043&lt;BR /&gt;1044&lt;BR /&gt;1045&lt;BR /&gt;1047&lt;BR /&gt;1&lt;BR /&gt;10000&lt;BR /&gt;1048&lt;BR /&gt;1049&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thank you for yoour help already!&lt;/DIV&gt;&lt;DIV&gt;Tobi&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 22:05:19 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Problem-with-listing-team-folder-with-python-SDK-Error-in-call/m-p/611411#M2797</guid>
      <dc:creator>Tobiwan</dc:creator>
      <dc:date>2022-07-22T22:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with listing team folder with python SDK:  Error in call to API function "files/lis</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Problem-with-listing-team-folder-with-python-SDK-Error-in-call/m-p/611491#M2798</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1559004"&gt;@Tobiwan&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The subfolders get printed only to around 1500 and in a weird order. For the 1500 i probably have to use recusion again right but how do i activate it in that context? ...&lt;/SPAN&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Hi &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1559004"&gt;@Tobiwan&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Currently, in your code, you are using only &lt;A title="Starts returning the contents of a folder" href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox_client.Dropbox.files_list_folder" target="_blank" rel="noopener"&gt;files_list_folder&lt;/A&gt; method. This method starts content listing process and can fetch the list entirely if it's small enough, but you don't have to rely on! Within the &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/files.html#dropbox.files.ListFolderResult" target="_blank" rel="noopener"&gt;retrieved result&lt;/A&gt; is a field 'has_more' (i.e. are some entries lefts to be fetched). If there are, you have to continue listing using &lt;A title="Paginate through all files and retrieve updates to the folder" href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox_client.Dropbox.files_list_folder_continue" target="_blank" rel="noopener"&gt;files_list_folder_continue&lt;/A&gt; method until there are no more entries left. On every pagination step, cursor take place within result; a cursor which you have to use as argument on following call. In such a way you will no more be limited to entries number able to be got out from single call.&lt;/P&gt;&lt;P&gt;Recursion can be activated using the corresponding argument (the same named) in the initial listing step. &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; There are other parameters too that control the listing process; take a look there. Listing order can't get controlled; it's something internal, you shouldn't rely on.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Jul 2022 12:09:14 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Problem-with-listing-team-folder-with-python-SDK-Error-in-call/m-p/611491#M2798</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2022-07-23T12:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with listing team folder with python SDK:  Error in call to API function "files/lis</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Problem-with-listing-team-folder-with-python-SDK-Error-in-call/m-p/611808#M2803</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1559004"&gt;@Tobiwan&lt;/a&gt; As Здравко instructed, make sure you implement support for the pagination in order to be able to retrieve all entries. Refer to the documentation they linked to for more information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox_client.Dropbox.sharing_create_shared_link_with_settings" target="_blank"&gt;sharing_create_shared_link_with_settings&lt;/A&gt;, you can call it the same way, like this:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;output = dbx.Dropbox(dropbox_token).with_path_root(dbx.common.PathRoot.root(team_space_namespace_id)).sharing_create_shared_link_with_settings("/test.txt")
print(output)&lt;/LI-CODE&gt;
&lt;P&gt;Be sure to plug in your actual path, in place of my example "/test.txt". You can programmatically get the path for an entry from &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/files.html?highlight=Metadata#dropbox.files.Metadata" target="_blank"&gt;Metadata&lt;/A&gt;.path_lower, for instance.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2022 15:08:11 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Problem-with-listing-team-folder-with-python-SDK-Error-in-call/m-p/611808#M2803</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2022-07-25T15:08:11Z</dc:date>
    </item>
  </channel>
</rss>

