cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Back again with another edition of 'How we use Dropbox', so find out how Emma uses to-do lists to get it all done 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: 

empty response from copy api

empty response from copy api

shivam19
Explorer | Level 3

https://api.dropboxapi.com/2/files/copy_v2

Two cases

1)  id of files in both the input "from_path" and "to_path", 

2) id of folder in "from_path" id of a file in "to_path". 

it gives EMPTY response, with 500 internal server error.

can you provide a specific error message ?

1 Accepted Solution

Accepted Solutions

Re: empty response from copy api

Greg-DB
Dropboxer

Thanks for the additional details! I'm able to reproduce this now.

It looks like this can happen when you specify a "to_path" value of a ID for a file with an extra path component appended on ("/new" in your case). Since the file ID is already for a file, you can't add an extra path component. (Files can only be nested inside folders, not files.) I'll ask the team to return a better error in this case.

Instead, you should supply the path where you want to put the file copy (like "/folder/newfile.ext"), or a file ID (like "id:FHpvNWBYUsAAAAAAAAAAdQ"), or the ID for a folder with a sub-path appended (like "id:ABC1234"/newfile.ext" where "id:ABC1234" is the ID for a folder).

View solution in original post

5 Replies 5

Re: empty response from copy api

Greg-DB
Dropboxer

This issue isn't reproducing for me. It's possible there's some other condition necessary to reproduce this.

Can you share the code you're using to reproduce this, as well as some sample "X-Dropbox-Request-Id" response header values for these errors? That would help us investigate. Please don't post your access token though. Thanks in advance! 

Re: empty response from copy api

shivam19
Explorer | Level 3

Hello Greg,

Thank you for your response.

I have tried this from postman only.

In postman, I am getting 500Internal Server Error.

URL : https://api.dropboxapi.com/2/files/copy_v2

Req Body : 

{
      "from_path": "id:FHpvNWBYUsAAAAAAAAAAag",
     "to_path": "id:FHpvNWBYUsAAAAAAAAAAdQ/new"
}

dropbox_copy.PNG

 

Re: empty response from copy api

Greg-DB
Dropboxer

Thanks for the additional details! I'm able to reproduce this now.

It looks like this can happen when you specify a "to_path" value of a ID for a file with an extra path component appended on ("/new" in your case). Since the file ID is already for a file, you can't add an extra path component. (Files can only be nested inside folders, not files.) I'll ask the team to return a better error in this case.

Instead, you should supply the path where you want to put the file copy (like "/folder/newfile.ext"), or a file ID (like "id:FHpvNWBYUsAAAAAAAAAAdQ"), or the ID for a folder with a sub-path appended (like "id:ABC1234"/newfile.ext" where "id:ABC1234" is the ID for a folder).

View solution in original post

Re: empty response from copy api

shivam19
Explorer | Level 3

Hello Greg,

 

Thank you for the explanation.

 

We are writing web-services, error handling part. I encountered one more scenario :

If we provide a wrong folder id(which doesn't exist) in "from_path", it gives the proper error message as : 

{
    "error_summary""from_lookup/not_found/...",
    "error": {
        ".tag""from_lookup",
        "from_lookup": {
            ".tag""not_found"
        }
    }
}
 
But when we give a wrong folder id in "to_path", then it gives an empty response body with 500 internal server error.
copy_error_2.PNG

Re: empty response from copy api

Greg-DB
Dropboxer

Thanks for the report! I'll ask the team to fix the error reporting in that case too.

Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
  • User avatar
    shivam19 Explorer | Level 3
What do Dropbox user levels mean?
Need more support?