I am trying to make a small app which when gets an input of public dropbox URL, returns you the file. But when an invalid URL is entered, the status received is 200. But there is image showing 404. Is there a way or a api through which I could check if the shared link is valid or not?
Unfortunately, we don't currently have a good way to detect this programmatically, but I'll be sure to pass this along as a request.
The only workaround right now would be to change the hostname from www.dropbox.com to dl.dropboxusercontent.com. The response on the latter would give a success or failure response code, but this isn't documented so it isn't officially supported.
What do you mean when you say it's not working? The first version of your link has a 200 code with a 404 page as described earlier in this thread, but the second version of the link does have a 403 code that you can detect programmatically.
In any case, we do have a better way to check links like this now. You can use the API v2 /sharing/get_shared_link_metadata endpoint to get shared link metadata or an error for shared links like this:
We love to learn from the educators who use Dropbox. Whether you teach kids, teens, adults or a combination of all three, we want to know what apps and integrations you use with Dropbox to help with teaching. Which of the ones below is your favorite, or most used tool?