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: 

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

Highlighted

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

Explorer | Level 3

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
Highlighted

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

Dropboxer

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
Highlighted

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

Dropboxer

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

Highlighted

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

Explorer | Level 3

Thank you .....thats works perfectly

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?