<?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: Dropbox API (Python) - How to get access to Team and User files in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-Python-How-to-get-access-to-Team-and-User-files/m-p/733836#M32424</link>
    <description>&lt;P&gt;This gives same error:&lt;BR /&gt;&lt;BR /&gt;This API function operates on a single Dropbox account, but the OAuth 2 access token you provided is for an entire Dropbox Business team.&lt;/P&gt;</description>
    <pubDate>Fri, 01 Dec 2023 10:46:10 GMT</pubDate>
    <dc:creator>Schwankenson</dc:creator>
    <dc:date>2023-12-01T10:46:10Z</dc:date>
    <item>
      <title>Dropbox API (Python) - How to get access to Team and User files</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-Python-How-to-get-access-to-Team-and-User-files/m-p/733536#M32414</link>
      <description>&lt;P&gt;I created the whole issue with code examples here:&lt;BR /&gt;&lt;A href="https://stackoverflow.com/questions/77577897/dropbox-api-python-how-to-get-access-to-team-and-user-files" target="_blank"&gt;https://stackoverflow.com/questions/77577897/dropbox-api-python-how-to-get-access-to-team-and-user-files&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I have a dropox business user which is member of the team. I would like to see the filesystem with the API like when I just login to dropbox.com: Member and team files and folder.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;So I'm creating a dropbox authentication code with, but when i`m calling dbx.file_list_folders() I get error&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;This API function operates on a single Dropbox account, but the OAuth 2 access token you provided is for an entire Dropbox Business team. Since your &lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;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" URL parameter to specify the exact user &amp;lt;&lt;A href="https://www.dropbox.com/developers/documentation/http/teams" target="_blank"&gt;https://www.dropbox.com/developers/documentation/http/teams&lt;/A&gt;&amp;gt;.')&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I can do something like that:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;dbx_team = dropbox.DropboxTeam(ACCESS_TOKEN)&lt;BR /&gt;dbx = dbx_team.as_user("YOUR_TEAM_MEMBER_ID")&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;But then I need to know the "YOUR_TEAM_MEMBER_ID" - And it is not possible to get it from API. Or is it?&lt;BR /&gt;&lt;BR /&gt;I created the whole issue with code examples here:&lt;BR /&gt;&lt;A href="https://stackoverflow.com/questions/77577897/dropbox-api-python-how-to-get-access-to-team-and-user-files" target="_blank"&gt;https://stackoverflow.com/questions/77577897/dropbox-api-python-how-to-get-access-to-team-and-user-files&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2023 11:16:22 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-Python-How-to-get-access-to-Team-and-User-files/m-p/733536#M32414</guid>
      <dc:creator>Schwankenson</dc:creator>
      <dc:date>2023-11-30T11:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: Dropbox API (Python) - How to get access to Team and User files</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-Python-How-to-get-access-to-Team-and-User-files/m-p/733539#M32415</link>
      <description>&lt;P&gt;Hi &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1775835"&gt;@Schwankenson&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;What about using &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox_client.Dropbox.users_get_current_account" target="_blank" rel="noopener"&gt;users_get_current_account&lt;/A&gt; method? 🧐&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;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2023 11:40:20 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-Python-How-to-get-access-to-Team-and-User-files/m-p/733539#M32415</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2023-11-30T11:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: Dropbox API (Python) - How to get access to Team and User files</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-Python-How-to-get-access-to-Team-and-User-files/m-p/733569#M32419</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1775835"&gt;@Schwankenson&lt;/a&gt; This error message is referring to specifying what account on the team to operate on behalf of. For reference, when using any "team scopes", the resulting access token is connected to an entire Dropbox team, not an individual account. So, when using a team-scoped access token to access user-specific endpoints, such as &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder" target="_blank"&gt;/2/files/list_folder&lt;/A&gt; (which is what the &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox_client.Dropbox.files_list_folder" target="_blank"&gt;files_list_folder&lt;/A&gt; method in the Python SDK uses), you will need to specify which member of the team you want to operate on behalf of.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;To do this, you'd need to &lt;A href="https://www.dropbox.com/developers/documentation/http/teams#teams-member-file-access" target="_blank" rel="noopener noreferrer"&gt;specify the 'Dropbox-API-Select-User' header&lt;/A&gt; (or 'Dropbox-API-Select-Admin' as needed/desired). The value should be the team_member_id for whichever member you wish to act on behalf of. In the Dropbox Python SDK, that can be set using &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html?highlight=dropbox.dropbox_client.DropboxTeam#dropbox.dropbox_client.DropboxTeam.as_user" target="_blank" rel="nofollow noopener noreferrer"&gt;as_user&lt;/A&gt; (or &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html?highlight=dropbox.dropbox_client.DropboxTeam#dropbox.dropbox_client.DropboxTeam.as_admin" target="_blank" rel="nofollow noopener noreferrer"&gt;as_admin&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can get the member ID for a team member from a number of different endpoints on the API, such as&amp;nbsp;&lt;A href="https://www.dropbox.com/developers/documentation/http/teams#team-members-get_info" target="_blank"&gt;/2/team/members/get_info_v2&lt;/A&gt;, which &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox_client.DropboxTeam.team_members_get_info_v2" target="_blank" rel="noopener noreferrer"&gt;team_members_get_info_v2&lt;/A&gt; in the Python SDK, or &lt;A href="https://www.dropbox.com/developers/documentation/http/teams#team-members-list" target="_blank"&gt;/2/team/members/list_v2&lt;/A&gt;/&lt;A href="https://www.dropbox.com/developers/documentation/http/teams#team-members-list-continue" target="_blank"&gt;/2/team/members/list/continue_v2&lt;/A&gt;, which are &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox_client.DropboxTeam.team_members_list_v2" rel="noopener noreferrer" target="_blank"&gt;team_members_list_v2&lt;/A&gt;/&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox_client.DropboxTeam.team_members_list_continue_v2" rel="noopener noreferrer" target="_blank"&gt;team_members_list_continue_v2&lt;/A&gt;.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;Also, note that using any team scopes means that only team admins can authorize the app. If you just want to connect to a particular account though (in which case any account can connect the app, but to their own account only), you can omit the team scopes. The access token without the team scopes will be specific to the particular account (whether on a team or not) and so will not require the additional header. You can find more information on scopes in &lt;A href="https://www.dropbox.com/lp/developers/reference/oauth-guide" target="_blank" rel="noopener noreferrer"&gt;the OAuth Guide&lt;/A&gt;. If you don't need to call any team endpoints, e.g., if you just need to call individual endpoints, such as &lt;A href="https://www.dropbox.com/developers/documentation/http/documentation#files-list_folder" target="_blank"&gt;/2/files/list_folder&lt;/A&gt; (&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox_client.Dropbox.files_list_folder" target="_blank"&gt;files_list_folder&lt;/A&gt;), I recommend this solution instead for simplicity and security.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2023 14:32:05 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-Python-How-to-get-access-to-Team-and-User-files/m-p/733569#M32419</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2023-11-30T14:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: Dropbox API (Python) - How to get access to Team and User files</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-Python-How-to-get-access-to-Team-and-User-files/m-p/733836#M32424</link>
      <description>&lt;P&gt;This gives same error:&lt;BR /&gt;&lt;BR /&gt;This API function operates on a single Dropbox account, but the OAuth 2 access token you provided is for an entire Dropbox Business team.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 10:46:10 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-Python-How-to-get-access-to-Team-and-User-files/m-p/733836#M32424</guid>
      <dc:creator>Schwankenson</dc:creator>
      <dc:date>2023-12-01T10:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: Dropbox API (Python) - How to get access to Team and User files</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-Python-How-to-get-access-to-Team-and-User-files/m-p/733838#M32426</link>
      <description>&lt;P&gt;Thank you. I understand the error message. But when I create the Authentication Code, I have to authenticate at dropbox with a specific account. And I do not understand, why this specific account is not saved in the authentication code.&lt;BR /&gt;&lt;BR /&gt;What I now do is, looping through the team members and use as_user() to a user with a specific email address. But this is really clunky I think.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 10:49:15 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-Python-How-to-get-access-to-Team-and-User-files/m-p/733838#M32426</guid>
      <dc:creator>Schwankenson</dc:creator>
      <dc:date>2023-12-01T10:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: Dropbox API (Python) - How to get access to Team and User files</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-Python-How-to-get-access-to-Team-and-User-files/m-p/733868#M32427</link>
      <description>&lt;P&gt;While a particular team admin account is needed to authorize the app when using any team scopes, the resulting connection is to the entire team, not just that particular account. You can check which account was used to authorize a particular team-linked access token though by calling &lt;A href="https://www.dropbox.com/developers/documentation/http/teams#team-token-get_authenticated_admin" target="_blank"&gt;/2/team/token/get_authenticated_admin&lt;/A&gt; (&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox_client.DropboxTeam.team_token_get_authenticated_admin" target="_blank"&gt;team_token_get_authenticated_admin&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you do only need to connect to the one account, I recommend omitting the team scopes instead, so that the connection would be to a specific account and you wouldn't need to use as_user.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2023 13:36:12 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Dropbox-API-Python-How-to-get-access-to-Team-and-User-files/m-p/733868#M32427</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2023-12-01T13:36:12Z</dc:date>
    </item>
  </channel>
</rss>

