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

unshiftmedia's avatar
unshiftmedia
New member | Level 2
5 years ago

Trying to Move Files Between Folders with API

I'm trying to move files between folders using the HTTP API. I used this endpoint to get all of the files inside a specific folder: https://api.dropboxapi.com/2/files/list_folder. It returns this response as expected:

{
    "entries": [
        {
            ".tag": "file",
            "name": "ui-debug.log",
            "path_lower": "/apps/articles/new/ui-debug.log",
            "path_display": "/Apps/Articles/New/ui-debug.log",
            "id": "redacted",
            "client_modified": "2020-09-23T19:06:36Z",
            "server_modified": "2020-09-23T19:18:02Z",
            "rev": "redacted",
            "size": 50,
            "is_downloadable": true,
            "has_explicit_shared_members": true,
            "content_hash": "redacted"
        }
    ],
    "cursor": "redacted",
    "has_more": false
}
 
Then I go to move the file to the new folder and using this endpoint: https://api.dropboxapi.com/2/files/move_v2. I pass all the same authorization data and pass this as the body:
{
    "from_path": "/apps/articles/new/ui-debug.log",
    "to_path": "/apps/articles/archived",
    "allow_shared_folder": true,
    "autorename": true,
    "allow_ownership_transfer": true
}
 
This is the response I get:
 
{
    "error_summary": "from_lookup/not_found/.",
    "error": {
        ".tag": "from_lookup",
        "from_lookup": {
            ".tag": "not_found"
        }
    }
}
Am I missing something here? I'm passing the exact path I get when I list the files. Please advise.
  • unshiftmedia's avatar
    unshiftmedia
    New member | Level 2

    I figured it out, I was using the wrong header.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,888 PostsLatest Activity: 22 hours 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!