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
cvc_dolphin
7 years agoExplorer | Level 4
Dropbox REST API to update file's metadata
I want to rename a file with dropbox rest api.
Well, it's possible with /move_v2 but we need to provide from_path and to_path values.
In my understanding, renaming a file is just updating its metadata. As dropbox provides an api to get metadata, is there any way to update it. I mean provided the id of file, can I change it's metadata?
I have posted my concern regading this on stackoverflow here.
Can anyone help me resolve this?
- Greg-DBDropbox Staff
Using /2/files/move_v2 is the correct way to rename a file, even if you don't need to move its folder location.
For example, to rename a file inside a "Documents" folder, you would supply values like:from_path:"/Documents/old_name", to_path:"/Documents/new_name"
Or, using the ID, you would still use move_v2, with values like:from_path:"id:abcfileid", to_path:"/Documents/new_name"
Or, you can even use values relative to the parent folder ID, like:from_path:"id:xyzfolderid/old_name", to_path:"id:xyzfolderid/new_name"
- cvc_dolphinExplorer | Level 4
Fab...!
Yes, we can rename a file in multiple ways but we either need to have a complete or relative path to file. What if I want to rename a file provided its id only?
I mean other provders like google drive, one drive, box provide a way to deal with file metadata. Whereas, dropbox is providing only a way to access only file metadata but not to update it.
So I was wondering if there is any way to deal with such operation when I am having only the id of a file.
Thanking you in anticipation
- Greg-DBDropbox StaffThanks for following up. The Dropbox API doesn't offer a way to rename the file using just its id and new name without specifying the new path, but I'll pass this along as a feature request.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,877 PostsLatest Activity: 12 months 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!