We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
JoelPelaezDot
6 years agoNew member | Level 2
I can add an existing member to a shared folder but folder is not available for that member
I created a folder (inside of a Team folder), shared it, and added a member (group) and getting null as a response which according to the documentation means success!. But when I log in to dropbox wi...
Greg-DB
Dropbox Community Moderator
6 years agoThere aren't any other methods that aren't documented that you would need to perform these operations.
You can share folders using /2/sharing/share_folder and add members to any particular shared folder using /2/sharing/add_folder_member.
Note however that having nested shared folders is only allowed inside team folders. Outside of team folders, attempting to make nested shared folders will result in the error you mentioned.
It sounds like you're trying to do this outside of a team folder. Try reconfiguring your API calls to do this inside a team folder. You can call /2/sharing/share_folder on any particular folder inside a team folder to share it and get a shared folder ID for it, if it's not already shared, and then call /2/sharing/add_folder_member with the shared folder ID for the particular folder you want to share.
Please note though that there are two different configurations that a Business team can use: with a "team space", or without a "team space". Without a team space, team folders are mounted inside each member's account. With a team space, team folders are mounted outside each member's account. If the team you're working with is using a team space, you'll need to explicitly set a header on your API calls to operate inside the team space (where nested shared folders are supported). You can find information on how to do that in the Namespace Guide.
JoelPelaezDot
6 years agoNew member | Level 2
1. I am using one requet to get main information like this:
"root_info": {
".tag": "team",
"root_namespace_id": "7448463488",
"home_namespace_id": "7447123984",
"home_path": "/joe pel"
}
2. Then I'm getting metadata for "root_namespace_id": "7448463488" and the response include this :
"is_team_folder": true,
"owner_team": {
"id": "dbtid:AADIOpY5DVcPBYhnc5BFOM9ILG2jw2U4nm8",
"name": "TeamApril"
},
"name": "Your team's shared workspace",
3. I am creating a new Team folder inside of this root folder by using Team APIs and sending the right params in the header using root tag or namespace tag, the folder is created successfully but "is_team_folder" is always false, I decided to cotinue creating other folders inside this folder but when calling share_folder I am just getting error like previous posts.
Can you point me to a sample or any existing code ?
thanks
- Greg-DB6 years ago
Dropbox Community Moderator
That output indicates that the team you're connected to does use the "team space" configuration.
The 'is_team_folder' will be returned as true for the team space itself, as you saw, but not for other folders inside the team space. Those other folders still get their own shared folder IDs though.
It sounds like you're seeing 'already_shared' errors though? (For reference, it's easier for us to help if you post the code and error you're getting.) In this case, that's likely because folders inside a "team space" in particular will get shared automatically. So, for example, after creating the folder, you can get its metadata to get its shared folder ID, like this, from my own testing:
curl -X POST https://api.dropboxapi.com/2/files/get_metadata \ --header "Authorization: Bearer <ACCESS_TOKEN>" \ --header "Dropbox-API-Select-User: <TEAM_MEMBER_ID>" \ --header 'Dropbox-API-Path-Root: {".tag": "root", "root": "1990815600"}' \ --header "Content-Type: application/json" \ --data "{\"path\": \"/test_414984_2\"}" # { # ".tag": "folder", # "name": "test_414984_2", # "path_lower": "/test_414984_2", # "path_display": "/test_414984_2", # "parent_shared_folder_id": "1990815600", # "id": "id:AAFTM3U8MQAAAAAAAAADiQ", # "shared_folder_id": "7575688240", # "sharing_info": { # "read_only": false, # "parent_shared_folder_id": "1990815600", # "shared_folder_id": "7575688240", # "traverse_only": false, # "no_access": false # } # }I can then use that shared folder ID (7575688240 in my case) with /2/sharing/add_folder_member to add members to just this new folder.
curl -X POST https://api.dropboxapi.com/2/sharing/add_folder_member \ --header "Authorization: Bearer <ACCESS_TOKEN>" \ --header "Dropbox-API-Select-User: <TEAM_MEMBER_ID>" \ --header 'Dropbox-API-Path-Root: {".tag": "root", "root": "1990815600"}' \ --header "Content-Type: application/json" \ --data "{\"shared_folder_id\": \"7575688240\",\"members\": [{\"member\": {\".tag\": \"email\",\"email\": \"user@example.com\"}}]}"
About Discuss Dropbox Developer & API
Make connections with 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!