You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
sarshavs
11 months agoExplorer | Level 3
Move file from users home folder to admin home folder
Hello im using team space configuration and trying to use this EP - https://api.dropboxapi.com/2/files/move_v2 to move file from user's home folder to admin home folder and i get 409, tried to ad...
sarshavs
Explorer | Level 3
Maybe im missing something here..
Im using team admin account to move file from user's home folder to admin's account home folder. when im using get_current_account to get the root id i get different ids for admin and for the user.
for example sarshavs user have root id : 4572232609 and Tomer - team admin have root id - 4572219937 now what should i do to move file from sarshavs home folder to Tomer home folder?
Thanks
Здравко
11 months agoLegendary | Level 20
As I said already and if you haven't count home name namespace as root namespace, then sarshavs and Tomer participate in different teams. Anyways...
In all cases (as Greg agreed too) you can use copy by reference and remove the file from the source at the end. If we assume you can access sarshavs files with user id $sarshavsUID and access token $sarshavsToken, then following call would give you a file reference:
fref=`curl -X POST https://api.dropboxapi.com/2/files/copy_reference/get -H "Authorization: Bearer $sarshavsToken" -H "Dropbox-Api-Select-User: $sarshavsUID" -H 'Content-Type: application/json' -d '{"path":"/Path/To/Existing/file.ext"}' | jq -r .copy_reference`
Now $fref holds the received reference. Next if we assume $tomerUID is id of Tomer and $tomerToken is corresponding token, following would paste the copied before file in Tomer owned space:
curl -X POST https://api.dropboxapi.com/2/files/copy_reference/save -H "Authorization: Bearer $tomerToken" -H "Dropbox-Api-Select-User: $tomerUID" -H 'Content-Type: application/json' -d "{\"copy_reference\":\"$fref\",\"path\":\"/Path/To/Paste/file.ext\"}"
The above are HTTP shell calls. Of course, you can use whatever you're using till now following the same pattern. In such a way you're not limited to any folder or account. 😉
Hope this helps.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,888 PostsLatest Activity: 22 hours agoIf 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 or Facebook.
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!