cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
If you’ve changed your email address, now's the perfect time to update it on your Dropbox account and we’re here to help! Learn more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

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

API V2 nightmares......... /move I cannot seem to move anyfolders inside any files or root

API V2 nightmares......... /move I cannot seem to move anyfolders inside any files or root

michaelwjoyner
Helpful | Level 5
Go to solution

 Everything that I try 

/

/folder1

/folder2

 

I am wanting to move folder1 into folder2..... THERE IS NO /folder2/folder1

I want this:

/

/folder1/folder2

 

I have tried all day, I am losing hair. I can see how V2 moves folders at all.

 

curl -X POST https://api.dropboxapi.com/2/files/copy
--header "Authorization: Bearer XXX"
--header "Content-Type: application/json"
--data "{
\"from_path\": \"/14a148a2-21bd-4e95-a16a-82081a6f9504/folder1\",
\"to_path\": \"/14a148a2-21bd-4e95-a16a-82081a6f9504/folder2\",
\"allow_shared_folder\": false,
\"autorename\": false}"

{"error_summary": "to/conflict/folder/.", "error": {".tag": "to", "to": {".tag": "conflict", "conflict": {".tag": "folder"}}}}

 

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

Hi Michael, the /copy and /move endpoints on the Dropbox API expect the "to_path" parameter to be the full path where you want to put the item specified by the "from_path" parameter. So, if you want to move folder1 into folder2, your "to_path" should be "/14a148a2-21bd-4e95-a16a-82081a6f9504/folder2/folder1". 

 

As is, your request is saying you want to copy folder1 to  "/14a148a2-21bd-4e95-a16a-82081a6f9504/folder2", and the API error is indicating that something already exists there.

 

Also, note that you said you want to move the folder, but your code is using the /2/files/copy endpoint. Moving files or folders is done via /2/files/move.

View solution in original post

2 Replies 2

Greg-DB
Dropbox Staff
Go to solution

Hi Michael, the /copy and /move endpoints on the Dropbox API expect the "to_path" parameter to be the full path where you want to put the item specified by the "from_path" parameter. So, if you want to move folder1 into folder2, your "to_path" should be "/14a148a2-21bd-4e95-a16a-82081a6f9504/folder2/folder1". 

 

As is, your request is saying you want to copy folder1 to  "/14a148a2-21bd-4e95-a16a-82081a6f9504/folder2", and the API error is indicating that something already exists there.

 

Also, note that you said you want to move the folder, but your code is using the /2/files/copy endpoint. Moving files or folders is done via /2/files/move.

michaelwjoyner
Helpful | Level 5
Go to solution
Thanks,

It was me. I need to make the "to" "/folder2/folder1" not "/folder"

THANKS GREG!!!!!!!
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    michaelwjoyner Helpful | Level 5
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?