Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

unshiftmedia's avatar
unshiftmedia
New member | Level 2
6 years ago
Solved

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.

1 Reply

Replies have been turned off for this discussion
  • unshiftmedia's avatar
    unshiftmedia
    New member | Level 2
    6 years ago

    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.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

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, Facebook or Instagram.

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!