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

Greater Than Consulting's avatar
Greater Than Consulting
Explorer | Level 3
8 months ago

move_batch API Request getting "relocation_error" "conflict" status

First let me start off by saying that I am not a coder. I just see patterns and typically figure out how to make things work.    I'm using Zapier to do a number of automations. One task that I'm ne...
  • Greg-DB's avatar
    8 months ago

    You can see what the result/error means by referring to the documentation, and clicking through the nested types as needed. For instance, from the /2/files/move_batch_v2 documentation, this 'failure/relocation_error/to/conflict/folder' for the entry in the complete.entries means that the entry was not moved because there's a folder in the way.

     

    That is, in this case, the item at "/Greater Than Consulting/Offers/SocialBusinessBot/Clients/RV Shepherd/Topic 1 Used" was not moved to "/Greater Than Consulting/Offers/SocialBusinessBot/Clients/RV Shepherd/Topic 1", because there's already a folder at the path "/Greater Than Consulting/Offers/SocialBusinessBot/Clients/RV Shepherd/Topic 1".

     

    I see that you said you're trying to make something for the "moving of all files from one folder to another". Note however that the Dropbox API does not directly offer a way to do that. I'll pass this along as a feature request, but I can't promise if or when that might be implemented.

     

    The Dropbox API, such as the /2/files/move_batch_v2 endpoint, allows you to specify one or more items themselves to move. For instance, if "/Greater Than Consulting/Offers/SocialBusinessBot/Clients/RV Shepherd/Topic 1 Used" refers to a folder, then specifying that as the "from_path" when calling the /2/files/move_batch_v2 endpoint would move that folder itself (including its contents), not just all of the contents of that folder.

     

    And the "to_path" would need to be the full path (including both the parent folder path as well as the file or folder name of the destination inside that parent folder) of where you want the item moved to.

     

    So, if you want to move all of the files inside one folder to be inside another already existing folder, you would need to send a list of entries with an object containing a "from_path" and a "to_path" with the full path for each file you want to move when calling the /2/files/move_batch_v2 endpoint. The API v2 Explorer can be useful for prototyping/testing calls like this. You can click "Add" multiple times to create multiple objects in the "entries" list, and fill those in and click "Show Code" to see what the resulting code would look like.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,882 PostsLatest Activity: 2 days ago
326 Following

If 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!