cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We’ve covered lots of big life moments in our ‘How we use Dropbox’ series - and now we even have some tips on how you can use Dropbox to keep the planning of a wedding as easy and as painless as possible over 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: 

Re: 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

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

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

Greg-DB
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

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

Greg-DB
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>\"}}]}"

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

slowdolphin
Explorer | Level 3

Thank you .....thats works perfectly

Need more support?