Your workflow is unique 👨‍💻 -  tell us how you use Dropbox here.

Forum Discussion

Getty I.'s avatar
Getty I.
New member | Level 1
9 years ago

Using save_url w/out specifying folder name

Is there an equivalent to .../1/save_url/auto in v2?  I noticed that when using the v2 save_url, I have to specify the default folder name whereas in v1, I could just use auto.  Please advise.

5 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    9 years ago

    The equivalent of API v1's /1/save_url in API v2 is /2/files/save_url

    Both of those endpoints do require that the app specify the destination path for the file, in the "path" parameter.

    The "auto" value from v1 was used in the "root" parameter, which identified the access type of your app ("sandbox" or "dropbox"), or let the API detect it for you ("auto"). The root parameter is not necessary for API v2, which will always use the "auto" behavior for you.

    So, when using API v2's /save_url, if you just supply the filename and extension, e.g. "/filename.ext", it will be placed in the app's root, either full Dropbox or an app folder depending on the permission, like it would in API v1 when you specified "auto".

    If the endpoint isn't working as expected of course, please share some code and output showing whatever issue you're running in to and we'll be happy to help.

  • Getty I.'s avatar
    Getty I.
    New member | Level 1
    9 years ago

    Thank you Gregory. I am having some issues in regards to where the API is reading and writing to when I leave out the folder name.

    For example,  I have an app whose App Name is My App. The access type says "This app has read/write access only to files inside it's folder".
    If I use save_url (https://api.dropboxapi.com/2/files/save_url )  and I only specify the file name (for example myfile.txt), the file gets written to Dropbox and not Dropbox->Apps->My App.

    A related issue is as follows: If I do specify the folder name in save_url (/My App/myfile.txt), the file is saved to that folder (Dropbox->Apps->My App).
    However, when I specify /MyFolder/myfile.txt when running get_metadata, I get a Httpstatuscode of 409. If I only request /myfile.txt (excluding the foldername), get_metadata will find the file.  Please help me understand how I should be able to write a file and check for that file.  

    Larry

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    9 years ago

    Thanks for the additional information Larry. We're looking into it and I'll follow up here once I have an update for you.

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    9 years ago

    Hi Larry, this should be working as expected again. Please let me know if you're still seeing any issues.

  • Getty I.'s avatar
    Getty I.
    New member | Level 1
    9 years ago

    Yes, works as exptected now.  Thank you much.

About Dropbox API Support and Feedback

Node avatar for Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.

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!