cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Tell us what you want to see on the Community here!
Close

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Add a group to a folder or sub folder NOT shared folder. C#

Highlighted

Add a group to a folder or sub folder NOT shared folder. C#

New member | Level 2

Hello all,

Was wondering how to add a group to a folder. 

For example we have Studio/WIP/158987

I want to make it where i can add a group called designers (already created in the front end and has 2 users in it) to the 158987 folder. How would i do this?

I have tried Sharing.AddFolderMember but it requires a sharedFolderId. That leads to my next question. What leads to a folder being classes as a shared folder?

I am using the DropboxTeamClient as we are hoping to use this as a business.

Code below.

var dbx = client.AsAdmin(memId);
dbx.Sharing.AddFolderMemberAsync()
1 Accepted Solution

Accepted Solutions
Highlighted

Re: Add a group to a folder or sub folder NOT shared folder. C#

Dropboxer

In order to add a group or member to a folder, that folder does need to be shared first.

If the folder is underneath a folder that is already shared, you may wish to add the group or member to that parent shared folder.

Or, you can share the specific folder itself. You can do so via the website as covered here, or via the API. In the .NET SDK in particular, you would use the ShareFolder method to do so.

View solution in original post

3 Replies 3
Highlighted

Re: Add a group to a folder or sub folder NOT shared folder. C#

Dropboxer

In order to add a group or member to a folder, that folder does need to be shared first.

If the folder is underneath a folder that is already shared, you may wish to add the group or member to that parent shared folder.

Or, you can share the specific folder itself. You can do so via the website as covered here, or via the API. In the .NET SDK in particular, you would use the ShareFolder method to do so.

View solution in original post

Highlighted

Re: Add a group to a folder or sub folder NOT shared folder. C#

New member | Level 2

Ahh i see.  Thanks Greg. I have got that bit working now. However how can i add a group?

So i have got the below: 

 var members = new[] { new AddMember(new MemberSelector.Email("email")) };
 await dbx.Sharing.AddFolderMemberAsync(sharedFolderId, members);

There is no "AddFolderGroupAsync". Not that i could find anyway.

Highlighted

Re: Add a group to a folder or sub folder NOT shared folder. C#

Dropboxer

To add a group, you should use the same AddFolderMemberAsync method, but you should use the MemberSelector.DropboxId selector (instead of MemberSelector.Email). You should put the group ID value there. Group IDs start with "g:". You can get the group IDs from GroupsListAsync/GroupsListContinueAsync.

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?