<?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: April 2024 Update to C# Example Code =&amp;gt;  This user doesn't belong to a team with shared space in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/April-2024-Update-to-C-Example-Code-gt-This-user-doesn-t-belong/m-p/766971#M33542</link>
    <description>&lt;P class="p1"&gt;Hi &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1398431"&gt;@Tech Dev Oldsmar&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;Thank you for providing this information! If your account team configuration is utilizing our updated team space functionality, the expected value for&amp;nbsp;account.RootInfo.IsTeam&amp;nbsp;will be&amp;nbsp;false, as the account will not belong to a team with a shared space.&lt;/P&gt;
&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;To determine the account team configuration, you will need to check the has_distinct_member_homes and has_team_shared_dropbox values while executing the &lt;A href="https://www.dropbox.com/developers/documentation/http/teams#team-features-get_values" target="_blank" rel="noopener"&gt;&lt;SPAN class="s1"&gt;/2/team/features/get_values&lt;/SPAN&gt;&lt;/A&gt;&amp;nbsp;endpoint. For further information on the latest updated team space, please review the following link:&lt;/P&gt;
&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL class="ul1"&gt;
&lt;LI class="li1"&gt;&lt;SPAN class="s2"&gt;&lt;A href="https://dropbox.tech/developers/api-updates-to-better-support-team-spaces" target="_blank" rel="noopener"&gt;&lt;SPAN class="s3"&gt;API updates to better support team spaces&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;That said, our&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/gh-pages/obj/api/Dropbox.Api.DropboxClient.html#Dropbox_Api_DropboxClient_WithPathRoot_Dropbox_Api_Common_PathRoot_" target="_blank" rel="noopener"&gt;WithPathRoot(PathRoot) method documentation example&lt;/A&gt;&amp;nbsp;will not work for the latest updated team space, and I have raised this to the engineering team&lt;/P&gt;</description>
    <pubDate>Mon, 29 Apr 2024 17:29:58 GMT</pubDate>
    <dc:creator>iNeil</dc:creator>
    <dc:date>2024-04-29T17:29:58Z</dc:date>
    <item>
      <title>April 2024 Update to C# Example Code =&gt;  This user doesn't belong to a team with shared space</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/April-2024-Update-to-C-Example-Code-gt-This-user-doesn-t-belong/m-p/766928#M33540</link>
      <description>&lt;P&gt;Dropbox has given ample warnings about adapting to Teams and Shared Spaces.&amp;nbsp; However, applying these updates have been staggered and this Sunday I lost all connections to team folders in a Blazor Server .NET 8 service class.&amp;nbsp; &amp;nbsp;I solved it by inverting this condition:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;if (!account.RootInfo.IsTeam)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;to&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;if (account.RootInfo.IsTeam)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I honestly don't know why this works but at least it got the production app back online. Reference to the DropboxClient WithPathRoot(PathRoot) code is &lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/gh-pages/obj/api/Dropbox.Api.DropboxClient.html#Dropbox_Api_DropboxClient_WithPathRoot_Dropbox_Api_Common_PathRoot_" target="_blank" rel="noopener"&gt;here&lt;/A&gt; and this is the example code in case it helps anyone:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;// Fetch root namespace info from user's account info.
var account = await client.Users.GetCurrentAccountAsync();

if (!account.RootInfo.IsTeam) // CHANGE THIS to (account.RootInfo.IsTeam)
{
    Console.WriteLine("This user doesn't belong to a team with shared space.");
}
else
{
    try
    {
        // Point path root to namespace id of team space.
        client = client.WithPathRoot(new PathRoot.Root(account.RootInfo.RootNamespaceId));
        await client.Files.ListFolderAsync(path);
    }
    catch (PathRootException ex)
    {
        // Handle race condition when user switched team.
        Console.WriteLine(
            "The user's root namespace ID has changed to {0}",
            ex.ErrorResponse.AsInvalidRoot.Value);
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2024 13:54:02 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/April-2024-Update-to-C-Example-Code-gt-This-user-doesn-t-belong/m-p/766928#M33540</guid>
      <dc:creator>Tech Dev Oldsmar</dc:creator>
      <dc:date>2024-04-29T13:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: April 2024 Update to C# Example Code =&gt;  This user doesn't belong to a team with shared space</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/April-2024-Update-to-C-Example-Code-gt-This-user-doesn-t-belong/m-p/766933#M33541</link>
      <description>&lt;P&gt;Here is the cleaned up code that now works after the switch-over update (early 2024) in re Teams/Shared Spaces:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public static async Task&amp;lt;ListFolderResult&amp;gt; ListFolderInTeamSpace(DropboxClient client, string path)
{
    try
    {
        var account = await client.Users.GetCurrentAccountAsync();
        return await client.Files.ListFolderAsync(path, client.WithPathRoot(new PathRoot.Root(account.RootInfo.RootNamespaceId)));
    }
    catch (PathRootException ex)
    {
        Console.WriteLine("The user's root namespace ID has changed to {0}", ex.ErrorResponse.AsInvalidRoot.Value);
        return new ListFolderResult();
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2024 14:21:01 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/April-2024-Update-to-C-Example-Code-gt-This-user-doesn-t-belong/m-p/766933#M33541</guid>
      <dc:creator>Tech Dev Oldsmar</dc:creator>
      <dc:date>2024-04-29T14:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: April 2024 Update to C# Example Code =&gt;  This user doesn't belong to a team with shared space</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/April-2024-Update-to-C-Example-Code-gt-This-user-doesn-t-belong/m-p/766971#M33542</link>
      <description>&lt;P class="p1"&gt;Hi &lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1398431"&gt;@Tech Dev Oldsmar&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;Thank you for providing this information! If your account team configuration is utilizing our updated team space functionality, the expected value for&amp;nbsp;account.RootInfo.IsTeam&amp;nbsp;will be&amp;nbsp;false, as the account will not belong to a team with a shared space.&lt;/P&gt;
&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;To determine the account team configuration, you will need to check the has_distinct_member_homes and has_team_shared_dropbox values while executing the &lt;A href="https://www.dropbox.com/developers/documentation/http/teams#team-features-get_values" target="_blank" rel="noopener"&gt;&lt;SPAN class="s1"&gt;/2/team/features/get_values&lt;/SPAN&gt;&lt;/A&gt;&amp;nbsp;endpoint. For further information on the latest updated team space, please review the following link:&lt;/P&gt;
&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL class="ul1"&gt;
&lt;LI class="li1"&gt;&lt;SPAN class="s2"&gt;&lt;A href="https://dropbox.tech/developers/api-updates-to-better-support-team-spaces" target="_blank" rel="noopener"&gt;&lt;SPAN class="s3"&gt;API updates to better support team spaces&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P class="p2"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;That said, our&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/gh-pages/obj/api/Dropbox.Api.DropboxClient.html#Dropbox_Api_DropboxClient_WithPathRoot_Dropbox_Api_Common_PathRoot_" target="_blank" rel="noopener"&gt;WithPathRoot(PathRoot) method documentation example&lt;/A&gt;&amp;nbsp;will not work for the latest updated team space, and I have raised this to the engineering team&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2024 17:29:58 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/April-2024-Update-to-C-Example-Code-gt-This-user-doesn-t-belong/m-p/766971#M33542</guid>
      <dc:creator>iNeil</dc:creator>
      <dc:date>2024-04-29T17:29:58Z</dc:date>
    </item>
  </channel>
</rss>

