cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more here.

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: 

Try to Share a Sub-Folder of a Team Folder using API

Try to Share a Sub-Folder of a Team Folder using API

slowdolphin
Explorer | Level 3
Go to solution

I can share a Shared folder to a member using

https://api.dropboxapi.com/2/sharing/add_folder_member
Data: {
    "shared_folder_id": "xxxxxxxxx",
    "members": [{
            "member": {
                ".tag": "email",
                "email": "mymail"
            },
            "access_level": "viewer"
        }],
    "quiet": false,
    "custom_message": "Documentation for launch day"
}

 

But I wanted to Share a Sub-Folder to a specific group of internal user so I created a Team Folder to do that.
However I am not sure which api I can call to assign a group to a sub folder under Team Folder.
Can someone please help me out here? I have Business Advance Account.

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

If you've already created the team folder, you can then share a sub folder under it using /2/sharing/share_folder, and then add the group as a member using /2/sharing/add_folder_member.

That would look like this:

curl -X POST https://api.dropboxapi.com/2/sharing/share_folder \
    --header "Authorization: Bearer <ACCESS_TOKEN>" \
    --header "Dropbox-API-Select-Admin: <ADMIN_MEMBER_ID>" \
    --header "Content-Type: application/json" \
    --data "{\"path\": \"ns:<TEAM_FOLDER_ID>/<SUBFOLDER_NAME>\"}"

curl -X POST https://api.dropboxapi.com/2/sharing/add_folder_member \
    --header "Authorization: Bearer <ACCESS_TOKEN>" \
    --header "Dropbox-API-Select-Admin: <ADMIN_MEMBER_ID>" \
    --header "Content-Type: application/json" \
    --data "{\"shared_folder_id\": \"<SHARED_FOLDER_ID>\",\"members\": [{\"member\": {\".tag\": \"dropbox_id\",\"dropbox_id\": \"<GROUP_ID>\"}}]}"

View solution in original post

2 Replies 2

Greg-DB
Dropbox Staff
Go to solution

If you've already created the team folder, you can then share a sub folder under it using /2/sharing/share_folder, and then add the group as a member using /2/sharing/add_folder_member.

That would look like this:

curl -X POST https://api.dropboxapi.com/2/sharing/share_folder \
    --header "Authorization: Bearer <ACCESS_TOKEN>" \
    --header "Dropbox-API-Select-Admin: <ADMIN_MEMBER_ID>" \
    --header "Content-Type: application/json" \
    --data "{\"path\": \"ns:<TEAM_FOLDER_ID>/<SUBFOLDER_NAME>\"}"

curl -X POST https://api.dropboxapi.com/2/sharing/add_folder_member \
    --header "Authorization: Bearer <ACCESS_TOKEN>" \
    --header "Dropbox-API-Select-Admin: <ADMIN_MEMBER_ID>" \
    --header "Content-Type: application/json" \
    --data "{\"shared_folder_id\": \"<SHARED_FOLDER_ID>\",\"members\": [{\"member\": {\".tag\": \"dropbox_id\",\"dropbox_id\": \"<GROUP_ID>\"}}]}"

slowdolphin
Explorer | Level 3
Go to solution

Thank you .....thats works perfectly

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    slowdolphin Explorer | Level 3
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?