Forum Discussion

TomH2's avatar
TomH2
New member | Level 2
6 years ago

save_url directly into folder_id

I'm trying to use the same functionality that the /upload endpoint has where you can specify which folder you want to upload into by directly using the folder_id ie 

```curl -X POST https://content.dropboxapi.com/2/files/upload \ --header 'Authorization: Bearer {token} \ --header 'Content-Type: application/octet-stream' \ --header 'Dropbox-API-Arg: {"path":"id:pAAp5E_74CAAAAAAAAAAMw/nametest"}' \ --data-binary @'image.jpg'```

It looks like in all of my tests with the explorer that the save_url endpoint doesnt behave the same way and requires you to use the full path to save a url directly into a folder, which would cause me to have to make 2 api calls, one to get the metadata for the folders path, and then another to do the actual upload, which isn't ideal.

Is there something I'm doing wrong on my end? Or is this just not a supported feature?

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    You're not doing anything wrong. The /2/files/save_url endpoint unfortunately just doesn't support specifying a path relative to the ID for a folder, like /2/files/upload does. I'll pass this along as a feature request, but I can't promise if or when that might be implemented.