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
ctubbs
5 years agoDropbox Staff
Python TypeError using Dropbox API move_v2function
Hi, I am trying to use the API to batch rename file. I had specific questions are around the move_v2 function:
I’m running dropbox.files.move_v2(params), where the args are from_path and to_path – As I understand it, we can’t rename files specifically, rather we just use move/move_v2.
However, I keep getting the below error:
I know the function exists as a result, but clearly I’m not using it correctly.
- Greg-DBDropbox Staff
Your image unfortunately is not loading. Can you try sharing that again?
- ctubbsDropbox Staff
Hi Greg, can you see this?
- Greg-DBDropbox Staff
Yes, thanks, that's visible now.
It looks like you're trying to call the Route object itself, but those aren't the methods for making API calls. To move or rename a file, you should use dropbox.Dropbox.files_move.
You can find some basic examples of making Dropbox API calls using the Dropbox Python SDK in this example, such as creating the client here, and making a call to start listing a folder here.
To use dropbox.Dropbox.files_move in particular, it would look like:
import dropbox dbx = dropbox.Dropbox("ACCESS_TOKEN_HERE") original_path = "/test.txt" new_path = "/renamed test.txt" result = dbx.files_move(from_path=original_path, to_path=new_path) print(result)
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,889 PostsLatest Activity: 2 days 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!