cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Whether you are transferring a single drive, a team or an entire organization, Movebot's cloud migration tool has been built to make your Dropbox migration simple - learn all about it here.

Discuss Dropbox Developer & API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Rename file via web api

Rename file via web api

vineet
Explorer | Level 3

Hello team ,

                     I want to rename a file or folder via web API. I am not able to find sepecific api for renaming. please help 

3 Replies 3

Re: Rename file via web api

Здравко
Super Collaborator | Level 20

Hi @vineet,

What are you doing when you rename something? 🤔 Isn't the same like you're moving content from one file/folder to another file/folder (with different name) in a same directory? Take a look on: https://www.dropbox.com/developers/documentation/http/documentation#files-move 😉

Re: Rename file via web api

vineet
Explorer | Level 3

Thanks for the reply. No intent to move file or folder. I just want to rename a folder and document name via web api.

Re: Rename file via web api

Greg-DB
Dropboxer

@vineet Здравко is correct, to rename a file via the API, you should use /2/files/move_v2. To rename a file, you should include the full path and file name for the old path/name and new path/name in the 'from_path' and 'to_path' parameters, respectively. You don't need to change any parent path components though. For example, you could specify "/Documents/oldname.ext" and "/Documents/newname.ext" to rename a file in the "Documents" folder.

 

By the way, that's a link to the documentation for the HTTPS endpoints themselves, but we recommend using one of the official SDKs if possible. Those have corresponding native methods for the HTTPS endpoints. 

Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
  • User avatar
    vineet Explorer | Level 3
  • User avatar
    Здравко Super Collaborator | Level 20
What do Dropbox user levels mean?
Need more support?