cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We are making some updates so the Community might be down for a few hours on Monday the 11th of November. Apologies for the inconvenience and thank you for your patience. You can find out more here.

Discuss Dropbox Developer & API

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

Attempt to rename drive file/folder “not found” (409)

Attempt to rename drive file/folder “not found” (409)

tragicdev
New member | Level 2
Go to solution

After reading the documentation here to rename an item, I'm not sure why I am getting a “not found” (409).

Here is the data of the item provided by https://api.dropboxapi.com/2/files/list_folder

Screenshot of the list_folder API response

tragicdev_0-1637182962772.png

Interesting that “id:” is prefixed in the string. As expected, I do get a 400 response because it does not match '[-_0-9a-zA-Z]+'

 

Going back to the requirements detailed in the docs, I took “id:” out to become “a_nxjuJ9zcUAAAAAAAAACQ”.

Screenshot of the request

tragicdev_1-1637183105998.png

 

I get back this 409 response.

tragicdev_2-1637183526281.png

 

I also tried removing “id:a” to “_nxjuJ9zcUAAAAAAAAACQ”, and when that didn't work, I removed “id:a_” and it still responded it couldn't be found. I thought perhaps because it's a folder, that's why, but even a PNG file could not be found/renamed either.

 

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

The /2/file_requests/update endpoint is for updating "file requests", not actual files/folders.

 

To rename a file or folder, you should use /2/files/move_v2. When supplying the "id" of a file or folder, supply it exactly as given. That is, do not remove the "id:" prefix or otherwise modify the value. To rename a folder, you would pass in the "id" as the "from_path" parameter, and the new path/name as the "to_path" parameter.

 

View solution in original post

2 Replies 2

Greg-DB
Dropbox Staff
Go to solution

The /2/file_requests/update endpoint is for updating "file requests", not actual files/folders.

 

To rename a file or folder, you should use /2/files/move_v2. When supplying the "id" of a file or folder, supply it exactly as given. That is, do not remove the "id:" prefix or otherwise modify the value. To rename a folder, you would pass in the "id" as the "from_path" parameter, and the new path/name as the "to_path" parameter.

 

tragicdev
New member | Level 2
Go to solution

Thank you! Confirmed this works.


Screenshot of response (200)

tragicdev_0-1637188849370.png

 

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    tragicdev New member | Level 2
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?