Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
I am trying to move a file from within a Shared Dropbox Folder using the Business API. I am attempting to do this through a 'DropBoxClient' instance. I first create a 'DropBoxTeamClient' using the access token specific to my dropbox application and then I impersonate a user that has Team Admin access and convert the 'DropBoxTeamClient' to a 'DropBoxClient' in order to gain access to the methods used to work with the files:
var client = teamClient.AsAdmin(userToImpersonate.Profile.TeamMemberId);
From there I have the ability to get and download file data and meta data. But when I need to move a file:
client.Files.MoveV2Async(file.Response.PathDisplay, toPath, true, true, true).Wait();
I get a 'Dropbox.Api.PathRootException' with a message of 'no_permission/...' . The client I'm using has Team Admin access and when I grab the metadata for both the folder I'm moving from/to as well as the file I'm trying to move, 'ReadOnly' is false, but the behavior suggests that I only have readonly access despite the value being false and the client having that level of access. I tried impersonating the owner of the shared folder and got the same result. I am able to move and delete through the dropbox UI but not throught the API. Is there some step/parameter that I am missing in the request? Here is the captured request body:
{"from_path":"/Test/Products/Import/TestZIP.zip","to_path":"/Test/Products/Import/TestZIP.zip","allow_shared_folder":true,"autorename":true,"allow_ownership_transfer":true}
And Response is a status of 244:
{"error_summary": "no_permission/", "error": {".tag": "no_permission"}}
[Cross-linking for reference: https://stackoverflow.com/questions/53110650/dropbox-permission-exception-thrown-when-moving-deletin... ]
Is that the actual request body, or did you modify it when posting it here? You seem to have the same value in both the "from_path" and "to_path" parameters, which should produce a different error.
Anyway, I think the issue may be that you need to use AsMember for this use case, instead of AsAdmin.
Please give that a try. If that doesn't help, please open an API ticket with the team member ID and the parameter values so we can look into this for you.
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on Twitter or Facebook.
For more info on available support options, see this article.
If you found the answer to your question, please 'like' the post to say thanks to the user!