Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
itsrainman
8 years agoExplorer | Level 3
Share a folder with team members using dropbox api v2.0
Hello, I am trying to create an app that will run on a internal remote server. The app 'listens' for XML files being generated by our BMS system and then processes these as required. The next...
chirstius
Dropbox Staff
8 years agoHello itsrainman,
You might want to take a look at the docs for the AddFolderMemberAsync() method. It takes an AddFolderMemberArg as it's parameter.
I'd try constructing a new AddFolderMemberArg, passing that in, and seeing if things work a little better.
Hope that helps,
-Chuck
itsrainman
8 years agoExplorer | Level 3
Many thanks.
Took a look and changed the code as required.
Dim shareFolderLaunch = Await dbx.Sharing.ShareFolderAsync(strFolder)
Dim sharedFolderId As String = ""
If shareFolderLaunch.IsAsyncJobId Then
While True
Dim shareFolderJobStatus = dbx.Sharing.CheckShareJobStatusAsync(shareFolderLaunch.AsAsyncJobId.Value)
If shareFolderJobStatus.IsFaulted Then
Console.WriteLine(("Sharing folder failed: " + shareFolderJobStatus.IsFaulted))
'return
ElseIf shareFolderJobStatus.status = TaskStatus.Running Then
Console.WriteLine("Sharing folder in progress...")
' todo: add some delay
ElseIf shareFolderJobStatus.IsCompleted Then
Console.WriteLine("Sharing folder complete.")
sharedFolderId = shareFolderJobStatus.Id
Exit While
End If
End While
ElseIf shareFolderLaunch.IsComplete Then
sharedFolderId = shareFolderLaunch.AsComplete.Value.SharedFolderId
Else
'Return
End If
Console.WriteLine(("Shared folder with ID: " + sharedFolderId))
Dim members = {New AddMember(New MemberSelector.Email("someemail@email.com"))}
Await dbx.Sharing.AddFolderMemberAsync(sharedFolderId, members)
All functions and I get an email :)
Just need to code in some error checks for an already shared folder etc, so getting there.
- itsrainman8 years agoExplorer | Level 3
Hello again all,
I have again had some time to spend on this today and I'm a little confused.
I have created a folder, this appears in dropbox and is shared with me.
I next add some files and I can see them if i inspect the folder.
However if I attempt to share the folder with another user via email I get the error "bad_path/already_shared/.."
I am just calling the original code that created the folder and then shared it with the first user - me,. How do i add additional users to the share?
- chirstius8 years ago
Dropbox Staff
Hey itsrainman,
Can you share a code sample of your call and the exact (full output) of the error response?
-Chuck
- chirstius8 years ago
Dropbox Staff
Actually, re-reading what you posted itsrainman-
Once you have shared the folder via ShareFolderAsync() (what I think you're calling "creating" it) you do not need to call that method again. It's already shared (as the response you're getting implies). You just need to make the call to AddFolderMemberAsync() with any new members you want to share the folder with.
Can you confirm if you're getting the error as a result of additional calls to ShareFolderAsync()? If so, I think that's where the issue lies.
Thanks,
-Chuck
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!