cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Known issues updated. Learn more
Highlighted

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

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

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>\"}}]}"
Reply
Loading...
2 Replies

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>\"}}]}"
Reply
Loading...

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

Level 3

Thank you .....thats works perfectly

Reply
Loading...
API Support

Have a question? Our Dropbox Community is here to help you find an answer!
You won’t have to wait too long for a reply, but why not learn more about the Community while you’re here.

Not the right discussion for you? Find out what else our Community has to say about API Support.

Or, search our Help Center for even more.

Who's talking
Top contributors to this post