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

Forum Discussion

Giorgio C.3's avatar
Giorgio C.3
New member | Level 1
10 years ago

Writing a file via API and make it always accessible publicly (like the old Public folder)

Hi,

This is my scenario: I need to write a file in users' Dropbox using the Core API and make it accessible (sharable) publicly and for a longer period (than 4 hours). I need somehow a similar behavior to the old Public folder, when the public link was available forever. I have noticed that if users share something via the "Share Dropbox link" they can set the expiration date or even remove it, but I cannot find a similar option via API.

So far, I am able to make the authentication, etc. and write anywhere/anything in a user's dropbox via the Core APIs but I cannot figure out how to make a file (or a folder) always accessible. The media API seems the closest way, but it expires after 4 hours.

Is there a way to do this?

Thanks so much!

Giorgio

6 Replies

Replies have been turned off for this discussion
  • Giorgio C.3's avatar
    Giorgio C.3
    New member | Level 1
    10 years ago

    Thanks, Gregory

    I would like to access the raw version of the file (which will be a JSON file). Is there a way to do that via API? I have noticed that the /media links expire after 4 hours...

  • Giorgio C.3's avatar
    Giorgio C.3
    New member | Level 1
    10 years ago

    That's great, thank you so much!

    The only downside of this is that the /shares link is not CORS enabled like the APIs, right? Having that &raw=1 option in the /shares endpoint would be great...

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

    That's correct, CORS isn't enabled on www.dropbox.com. The parameters ( dl or raw ) are preferred, but if they don't suit your use case, one alternative is to change host from www.dropbox.com to dl.dropboxusercontent.com, that is:

    www.dropbox.com/s/...

    to:

    dl.dropboxusercontent.com/s/...

    CORS does work on the latter host. That's not documented though, so I can't say it's officially supported.

    And thanks for the feedback. I'll pass this along as a request to put the raw option directly into the /shares endpoint.

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!