<?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: ParentSharedFolderId is Null when checking permissions in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/ParentSharedFolderId-is-Null-when-checking-permissions/m-p/413804#M22336</link>
    <description>&lt;P&gt;I was able to solve my issue by using the following to retrieve the folder's meta data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var itemMetaData = await userClient.Sharing.GetFolderMetadataAsync(item.SharedFolderId);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After that I got the parent folder's meta data and name from this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var parentSharedFolderMetadata = await userClient.Sharing.GetFolderMetadataAsync(itemMetaData.ParentSharedFolderId);&lt;BR /&gt;parentName = parentSharedFolderMetadata.Name;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Apr 2020 15:34:49 GMT</pubDate>
    <dc:creator>bmilinski</dc:creator>
    <dc:date>2020-04-24T15:34:49Z</dc:date>
    <item>
      <title>ParentSharedFolderId is Null when checking permissions</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/ParentSharedFolderId-is-Null-when-checking-permissions/m-p/413703#M22331</link>
      <description>&lt;P&gt;I previously made a program that goes through my entire team's DropBox permissions and creates a report from the data. It tells me their name, permissions for the current file/folder, the name of the current file/folder, and is supposed to share the parent folder's name. However, I am running into the issue of the "ParentSharedFolderID" being null even when I know from checking that the specified file/folder is in a parent folder. What could be causing this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is my code:&lt;/P&gt;
&lt;P&gt;private async void ButtonDebug_Click(object sender, EventArgs e)&lt;BR /&gt;{&lt;BR /&gt;ButtonDebug.Enabled = false;&lt;BR /&gt;&lt;BR /&gt;//use dropbox client with access token from app console&lt;BR /&gt;using (DropboxTeamClient DBTeamClient = new DropboxTeamClient("MYCLIENTIDHERE"))&lt;BR /&gt;{&lt;BR /&gt;//get all the dropbox members&lt;BR /&gt;var members = await DBTeamClient.Team.MembersListAsync();&lt;BR /&gt;//loop through all members ordered by email alphabetical&lt;BR /&gt;foreach (var member in members.Members.OrderBy(a =&amp;gt; a.Profile.Email))&lt;BR /&gt;{&lt;BR /&gt;int count = 0;&lt;BR /&gt;//get each user&lt;BR /&gt;var userClient = DBTeamClient.AsMember(member.Profile.TeamMemberId);&lt;BR /&gt;//actions to check&lt;BR /&gt;var actionsToCheck = new FolderAction[] { FolderAction.EditContents.Instance, FolderAction.InviteEditor.Instance };&lt;BR /&gt;//get each user's file information&lt;BR /&gt;var list = await userClient.Sharing.ListFoldersAsync(actions: actionsToCheck); // actions can optionally be supplied to check the permissions the user has for specific actions&lt;BR /&gt;//loop through the list of file and show permissions on folders&lt;BR /&gt;foreach (var item in list.Entries)&lt;BR /&gt;{&lt;BR /&gt;int length = item.AccessType.ToString().Length - 32 - 2;&lt;BR /&gt;System.Diagnostics.Debug.WriteLine("");&lt;BR /&gt;System.Diagnostics.Debug.WriteLine(member.Profile.Name.DisplayName);&lt;BR /&gt;System.Diagnostics.Debug.WriteLine(item.Name);&lt;BR /&gt;System.Diagnostics.Debug.WriteLine(item.AccessType.ToString().Substring(32, length));&lt;BR /&gt;string parentName = "N/A";&lt;BR /&gt;if (item.ParentSharedFolderId != null)&lt;BR /&gt;{&lt;BR /&gt;try&lt;BR /&gt;{&lt;BR /&gt;var parentSharedFolderMetadata = await userClient.Sharing.GetFolderMetadataAsync(item.ParentSharedFolderId);&lt;BR /&gt;System.Diagnostics.Debug.WriteLine(parentSharedFolderMetadata.Name);&lt;BR /&gt;parentName = parentSharedFolderMetadata.Name;&lt;BR /&gt;}&lt;BR /&gt;catch (DropboxException ex)&lt;BR /&gt;{&lt;BR /&gt;parentName = "N/A";&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;System.Diagnostics.Debug.WriteLine(count + "");&lt;BR /&gt;count++;&lt;BR /&gt;}&lt;BR /&gt;System.Diagnostics.Debug.WriteLine(count + " total folders");&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;ButtonDebug.Enabled = true;&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2020 12:43:10 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/ParentSharedFolderId-is-Null-when-checking-permissions/m-p/413703#M22331</guid>
      <dc:creator>bmilinski</dc:creator>
      <dc:date>2020-04-24T12:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: ParentSharedFolderId is Null when checking permissions</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/ParentSharedFolderId-is-Null-when-checking-permissions/m-p/413799#M22335</link>
      <description>&lt;P&gt;I see you're calling&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Sharing_Routes_SharingUserRoutes_ListFoldersAsync_1.htm" target="_self"&gt;Sharing.ListFoldersAsync&lt;/A&gt; to list the shared folders in the account. (By the way, make sure you check&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/P_Dropbox_Api_Sharing_ListFoldersResult_Cursor.htm" target="_self"&gt;ListFoldersResult.Cursor&lt;/A&gt; to see if there are more entries to retrieve, in which case you should call back to &lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Sharing_Routes_SharingUserRoutes_ListFoldersContinueAsync.htm" target="_self"&gt;ListFoldersContinueAsync&lt;/A&gt;.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/P_Dropbox_Api_Sharing_SharedFolderMetadataBase_ParentSharedFolderId.htm" target="_self"&gt;ParentSharedFolderId&lt;/A&gt; property will only be set if the folder itself is contained inside another shared folder. Are you sure you're seeing this absent for folders insider other shared folders? I ask because you only said "the specified file/folder is in a parent folder", but not specifically that the parent folder is shared.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that's not working properly though, please share the unexpected output you're seeing so we can take a look. You can &lt;A href="https://www.dropbox.com/developers/contact" target="_self"&gt;open an API ticket&lt;/A&gt; if you'd prefer to share privately.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the folder is in a non-shared parent folder and you want the path of that parent, you can retrieve it from the&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/P_Dropbox_Api_Sharing_SharedFolderMetadataBase_PathLower.htm" target="_self"&gt;PathLower&lt;/A&gt; property. Note that that will only be present if the folder is mounted though.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2020 15:30:16 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/ParentSharedFolderId-is-Null-when-checking-permissions/m-p/413799#M22335</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-04-24T15:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: ParentSharedFolderId is Null when checking permissions</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/ParentSharedFolderId-is-Null-when-checking-permissions/m-p/413804#M22336</link>
      <description>&lt;P&gt;I was able to solve my issue by using the following to retrieve the folder's meta data:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var itemMetaData = await userClient.Sharing.GetFolderMetadataAsync(item.SharedFolderId);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After that I got the parent folder's meta data and name from this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var parentSharedFolderMetadata = await userClient.Sharing.GetFolderMetadataAsync(itemMetaData.ParentSharedFolderId);&lt;BR /&gt;parentName = parentSharedFolderMetadata.Name;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2020 15:34:49 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/ParentSharedFolderId-is-Null-when-checking-permissions/m-p/413804#M22336</guid>
      <dc:creator>bmilinski</dc:creator>
      <dc:date>2020-04-24T15:34:49Z</dc:date>
    </item>
  </channel>
</rss>

