We Want to Hear From You! What Do You Want to See on the Community? Tell us here!

Forum Discussion

Tribecube T.'s avatar
Tribecube T.
New member | Level 1
11 years ago

How can I check if a link to a file is still valid or not?

After getting a preview link from the Dropbox Chooser (something like https://www.dropbox.com/s/d5hn63asdasd/asdasdasd.png?dl=0) how can I check at a later time that the resulting link is still valid (i.e. has not been revoked)?

If I GET the url I'll always get an 200 status code without any chance to detect the issue programmatically.

1 Reply

Replies have been turned off for this discussion
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    11 years ago

    The "preview" link type isn't meant for programmatic access, so unfortunately there isn't a good solution here. That being the case, the "direct" link type might work better for you, as it does return file content directly, and responds with the expected errors codes in these cases. They do expire after four hours though.

    Alternatively, though this isn't documented and may break, you can modify these links as such:

    https://dl.dropboxusercontent.com/s/d5hn63asdasd/asdasdasd.png

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,036 PostsLatest Activity: 3 days ago
411 Following

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

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!