<?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: Listing members in a team via Python in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Listing-members-in-a-team-via-Python/m-p/714140#M31644</link>
    <description>&lt;P&gt;Yes. The clients are a thin wrapper for the API, but, nonetheless, it's what we're using to access the API and the naming is intractable, at least to an unfamiliar user. The brief examples given on the website don't mention any of the team/business semantics. They only work for non-team accounts.&lt;/P&gt;</description>
    <pubDate>Sat, 16 Sep 2023 17:03:55 GMT</pubDate>
    <dc:creator>dsoprea</dc:creator>
    <dc:date>2023-09-16T17:03:55Z</dc:date>
    <item>
      <title>Listing members in a team via Python</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Listing-members-in-a-team-via-Python/m-p/714043#M31641</link>
      <description>&lt;P&gt;So, the event we receive via webhooks to a 'full dropbox'-scoped app looks like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;[2023-09-15 22:55:42,859 wew.handler_plugins.   DEBUG] Received Dropbox event:
{
    "delta": {
        "teams": {
            "dbtid:AADBsJ4zo2S_tS_n3iyHzatB4h16n2yT-2c": [
                "dbmid:AAAfY_5hmDSrYzFkd7T2BrWPPepevkydBY0",
                "dbmid:AAA22dYwGQDF4xFp03M2NWEZq_7jgJV0XX8",
                "dbmid:AAD0WqFm-gWxsfpUj1qAMXiUKYJTcGXRrjk"
            ]
        }
    },
    "list_folder": {
        "teams": {
            "dbtid:AADBsJ4zo2S_tS_n3iyHzatB4h16n2yT-2c": [
                "dbmid:AAAfY_5hmDSrYzFkd7T2BrWPPepevkydBY0",
                "dbmid:AAA22dYwGQDF4xFp03M2NWEZq_7jgJV0XX8",
                "dbmid:AAD0WqFm-gWxsfpUj1qAMXiUKYJTcGXRrjk"
            ]
        }
    }
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This differs from the folder-scoped app events, in that those have an 'accounts' list under the "list_folder" event/directive. I saw something somewhere that said that we should technically, probably, be receiving only one team ID at a time, but that under Dropbox's current architecture, we might receive more than one but that it's not predictable when. I also saw something somewhere else that mentioned that we should be enumerating all users for each team in order to then enumerate a stored cursor for each? That doesn't seem right. Can you clarify?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Meanwhile, I can't seem to even figure out which method to call to get the list of members for a given team ID (just to explore the possibility of the above). For reference, this is the Python team client/interface documentation:&amp;nbsp;&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/team.html" target="_blank" rel="noopener"&gt;https://dropbox-sdk-python.readthedocs.io/en/latest/api/team.html&lt;/A&gt;&amp;nbsp;. There's too much of a divide between the RPC naming conventions and the Python calling conventions. I've tried blindly calling `dbx.team_get_info(team_id)` and `dbx.team_members_get_info()` It's just not intuitive. Can you provide an example? I checked the examples/ path in the Python project, but there's almost nothing there, and none of it seems relevant. I've also search Google and StackOverflow, and there's just nothing out there.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, what is "delta" (in the event) and how do we use it? There were no relevant references found via the API documentation search nor the Python documentation search. We could use more recipes/examples in the documentation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2023 10:19:20 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Listing-members-in-a-team-via-Python/m-p/714043#M31641</guid>
      <dc:creator>dsoprea</dc:creator>
      <dc:date>2023-09-18T10:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Listing members in a team via Python</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Listing-members-in-a-team-via-Python/m-p/714081#M31642</link>
      <description>&lt;P&gt;Presumably, user-wise, I'm looking for a method that load those member IDs. I think I saw a class called TeamDropbox or BusinessDropbox, but it doesn't seem to be mentioned in the current Sphinx documentation.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Sep 2023 06:55:34 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Listing-members-in-a-team-via-Python/m-p/714081#M31642</guid>
      <dc:creator>dsoprea</dc:creator>
      <dc:date>2023-09-16T06:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: Listing members in a team via Python</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Listing-members-in-a-team-via-Python/m-p/714119#M31643</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1648401"&gt;@dsoprea&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;This differs from the folder-scoped app events, in that those have an 'accounts' list under the "list_folder" event/directive. ...&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/1648401"&gt;@dsoprea&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Yes, unfortunately documentation is a pain for Dropbox; and it's not only about API, it's the same for everything. 🤦🤷 Have you seen Dropbox official applications documentation? In this context the API documentation looks fine. &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@D88F213CAFB196B6AB70612B08AD9D31/emoticons/1f601.png" alt=":beaming_face_with_smiling_eyes:" title=":beaming_face_with_smiling_eyes:" /&gt;&lt;/P&gt;&lt;P&gt;You'll need to deduce what's there; no so difficult, I think. Just keep in mind that 'delta' part is obsolete and you will need to check only 'list_folder' content. They suppose to have the same information in different format (API v1 and API v2). As seems only API v2 is supplied as 2 copies; don't ask me why is it needed (API v1 wont recognize it, so it's meaningless to be there at all).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1648401"&gt;@dsoprea&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;... I saw something somewhere that said that we should technically, probably, be receiving only one team ID at a time, but that under Dropbox's current architecture, we might receive more than one but that it's not predictable when. ...&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Wherever you did read it, it's just not true and never has been. Presumably, multiple changes come together (of course, when as single change appears, it will be alone).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1648401"&gt;@dsoprea&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;... I also saw something somewhere else that mentioned that we should be enumerating all users for each team in order to then enumerate a stored cursor for each? That doesn't seem right. Can you clarify?&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;No exactly; Not all users, only all denoted users. Of course, if by any chance all users have changed something then all of them. You should take in mind that a single change may appears in multiple member contexts as change - for all members that can see it (i.e. the same change might appears many times).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1648401"&gt;@dsoprea&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;Meanwhile, I can't seem to even figure out which method to call to get the list of members for a given team ID ... There's too much of a divide between the RPC naming conventions and the Python calling conventions. ...&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Any Dropbox SDK (including Python one) is just a wrapper of API, nothing more. The SDK just perform the technical work of perform HTTP calls for you (in some places may be added additional wrappers like save content to file, etc. - just for convenience). In general SDKs calls are one to one match to API ones. You can call regular methods to get particular team members, but you don't need to - all members that have something changed are listed too (their IDs actually).&lt;/P&gt;&lt;P&gt;Something else may confuse you. If I have to bet, you skipped to save users credentials (either team members or personal users) and now trying to access changes without proper credentials (relying only on the received IDs). If so, it's impossible! That would be a security break if it was possible (just imagine - you got access only by id, hmmm... 🤫). It's your responsibility to keep all data needed to trace what's changing when notification comes up and indexing all sets of such information by corresponding IDs. &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;A title="Receiving notifications" href="https://www.dropbox.com/developers/reference/webhooks#notifications" target="_blank" rel="noopener"&gt;Here&lt;/A&gt; you can see some Python examples. They are for individual users, but I believe you can adapt them.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Sep 2023 13:30:21 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Listing-members-in-a-team-via-Python/m-p/714119#M31643</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2023-09-16T13:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: Listing members in a team via Python</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Listing-members-in-a-team-via-Python/m-p/714140#M31644</link>
      <description>&lt;P&gt;Yes. The clients are a thin wrapper for the API, but, nonetheless, it's what we're using to access the API and the naming is intractable, at least to an unfamiliar user. The brief examples given on the website don't mention any of the team/business semantics. They only work for non-team accounts.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Sep 2023 17:03:55 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Listing-members-in-a-team-via-Python/m-p/714140#M31644</guid>
      <dc:creator>dsoprea</dc:creator>
      <dc:date>2023-09-16T17:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Listing members in a team via Python</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Listing-members-in-a-team-via-Python/m-p/714143#M31645</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1648401"&gt;@dsoprea&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;... They only work for non-team accounts.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Yes, they are designed so. As seems it's difficult for you to adapt it!? 🧐&lt;/P&gt;&lt;P&gt;Try to change the line:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;for account in json.loads(request.data)['list_folder']['accounts']:&lt;/LI-CODE&gt;&lt;P&gt;...to something like:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;teams = json.loads(request.data)['list_folder']['teams']
for team in teams:
    for account in teams[team]:&lt;/LI-CODE&gt;&lt;P&gt;Everything else may stay the same (least for the test). 🙋&lt;/P&gt;&lt;P&gt;Hope this helps with the first steps of adaptation.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Sep 2023 17:59:05 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Listing-members-in-a-team-via-Python/m-p/714143#M31645</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2023-09-16T17:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: Listing members in a team via Python</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Listing-members-in-a-team-via-Python/m-p/714145#M31646</link>
      <description>Unfortunately, it's not the same. I've already tried. The API complains about the IDs not being the right length. Presumably because these are "member IDs" not account IDs. It looks like we need to use our access-token with the "DropboxTeam" class and then switch to the member using "as_user()".</description>
      <pubDate>Sat, 16 Sep 2023 18:10:08 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Listing-members-in-a-team-via-Python/m-p/714145#M31646</guid>
      <dc:creator>dsoprea</dc:creator>
      <dc:date>2023-09-16T18:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: Listing members in a team via Python</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Listing-members-in-a-team-via-Python/m-p/714148#M31647</link>
      <description>&lt;P&gt;As I said before, it's your responsibility to keep all needed information!!! The only work for all those accountId is to be unique and so you be able index whatever you have stored before, nothing more. Of course you can use it whenever applicable. For the test (just to see how it's working) temporary remove all team related scopes, so only token (alone) will be enough. Issue tokens anew.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Sep 2023 18:28:46 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Listing-members-in-a-team-via-Python/m-p/714148#M31647</guid>
      <dc:creator>Здравко</dc:creator>
      <dc:date>2023-09-16T18:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: Listing members in a team via Python</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Listing-members-in-a-team-via-Python/m-p/714466#M31651</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1648401"&gt;@dsoprea&lt;/a&gt; I see Здравко already offered some helpful guidance, but to add a bit more information:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When using only "user scopes", an app will only be linked to specific accounts, and webhooks would notify only about specific accounts. You can find &lt;A href="https://www.dropbox.com/developers/reference/webhooks" target="_blank"&gt;the documentation for that kind of webhooks here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When using "team scopes", an app will be linked to entire teams, and webhooks would notify at the team level, as you saw. You can find t&lt;A href="https://www.dropbox.com/developers/documentation/http/teams#webhooks" target="_blank"&gt;he team-specific webhooks documentation here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To call the API to get information about a particular team, you would use &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox_client.DropboxTeam.team_get_info" target="_blank"&gt;the team_get_info method&lt;/A&gt;. Note that that method does not take a team ID parameter as you have in your first comment. It takes no parameters and instead identifies the team based on the access token you use to make that call. Accordingly, you'll need to keep track of which access/refresh token is for which team.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To get the list of members for any given team, you would use &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox_client.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_client.DropboxTeam.team_members_list_continue" target="_blank"&gt;team_members_list_continue&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2023 13:34:18 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Listing-members-in-a-team-via-Python/m-p/714466#M31651</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2023-09-18T13:34:18Z</dc:date>
    </item>
  </channel>
</rss>

