Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
GustavBrock
10 months agoNew member | Level 1
Owner account of shared folder
Using C# and the Dropbox API and having attached shared folders from another Dropbox accounts, how do I retrieve the Dropbox account ids that own these shared folders?
Both my account and the owners of the shared folders use Dropbox Basic, thus no teams.
I need this account id to identify the folder holding the files reported to my webhook.
Hi GustavBrock,
Sending a request to /sharing/list_folder_members endpoint will return the members of a shared folder.
For member groups, there will be a property "group_id" per member group. For individual members, there will be an "account_id" property per member.
6 Replies
Replies have been turned off for this discussion
- DB-Des10 months ago
Dropbox Community Moderator
Hi GustavBrock,
Sending a request to /sharing/list_folder_members endpoint will return the members of a shared folder.
For member groups, there will be a property "group_id" per member group. For individual members, there will be an "account_id" property per member.
- GustavBrock10 months agoNew member | Level 1
Thanks!
I have the Dropbox.Api package installed to serve other tasks. Could this be used to retrieve the account_id? I can retrieve the folder metadata but this seems not to include the account_id.
- DB-Des10 months ago
Dropbox Community Moderator
Hi GustavBrock,
In order to further assist, could you provide the following?
- the name and version number of the platform and SDK/library you are using, if any
- the steps to reproduce the issue, including relevant code snippet(s), but don't include any access or refresh token(s)
- the full text of any error or unexpected output
- GustavBrock10 months agoNew member | Level 1
It is 7.0.0
I got it working. The https call responded with a missing scope error, because I hadn't set permission for sharing_read. That I did and reauthorized, and now also the Dropbox.Api code runs:
internal async Task ListFiles(DropboxClient dbx) { List<Metadata> allFolders = new List<Metadata>(); // <snip> .. fill allFolders foreach (var item in allFolders) { if (item.IsFolder) { Console.WriteLine($"{item.AsFolder.Id} - {item.Name}"); string sharedFolderId = item.AsFolder.SharingInfo.SharedFolderId; var folderMembers = await dbx.Sharing.ListFolderMembersAsync(sharedFolderId); var owner = folderMembers.Users.Where(user => user.AccessType.IsOwner).FirstOrDefault(); if (owner != null) { Console.WriteLine($"Owner Account ID: {owner.User.AccountId}"); } else { Console.WriteLine("Owner not found."); } } } }Thank you. Have a nice weekend!
- GustavBrock10 months agoNew member | Level 1
DB-Des: I forgot to return a thank you for your fast attention. Much appreciated!
- DB-Des10 months ago
Dropbox Community Moderator
My pleasure! I'm glad to see you got it working.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!