Forum Discussion

Ghislain Sommervogel's avatar
Ghislain Sommervogel
Helpful | Level 5
2 years ago

.NET API : How to copy files to HomeNamespaceId as an admin ?

Hi all,

I'm connected to a DropboxClient as an admin. I need to copy files from a team folder that my account isn't a member of to my HomeNamespaceId. For this, I'm using DropboxClient.Files.CopyV2Async. 

- the fromPath argument is filled with "ns:1234/copypath". Seems to work.

- the toPath is build this way : "ns:" + full.RootInfo.HomeNamespaceId + "/" + folderName

... where full  = DropboxClient.Users.GetCurrentAccountAsync() and folderName = a non-yet-existing directory that I want to create under my Home in order to share it later.

The call to DropboxClient.Files.CopyV2Async returns a "to/no_write_permission" error. Any idea of how I could solve this? As a workaround, I made my account a member of the team folder, so that I can connect "AsMember" and use CopyReferenceGetAsync, but that is not an ideal solution. Thanks for any advice.

2 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    2 years ago

    Unfortunately I don't believe there's an alternative in this scenario, because the /2/files/copy_v2 endpoint only supports the Dropbox-API-Select-Admin header in the "Team Admin" mode, meaning it has access to "team folders and team spaces but not the team members' home namespaces". So, when you administratively access contents the account doesn't have access to, you can't simultaneously access the user account's home folder.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from 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!