How do I get the public link of each file in dropbox? Is there a formula to create a public link for the files?
www.dropbox.com/help/167 and no, they are all random.
Some background -
I'm a developer and I want the direct download link of the file on dropbox. The Core API had a /media endpoint however, I'm using iOS Core APIs. Any idea how I should proceed?
To clarify a bit, "public links" refers to an older method of sharing that only applies to items in the Public folder:
https://www.dropbox.com/help/16
"Shared links" refers to a new method of sharing that can be applied to any item, regardless of location in the Dropbox account:
https://www.dropbox.com/help/167
On the API side of things, if you want to just access file content directly in your app, you should use /files (GET), which corresponds to the loadFile method in the iOS Core SDK.
loadFile
If that doesn't work for you though, you can use /media, which returns a temporary direct link to the file content. This corresponds to the loadStreamableURLForFile method in the iOS Core SDK.
loadStreamableURLForFile
Finally, if you want a shareable link, which doesn't expire (but can be revoked by the user), you can use /shares, which is accessible via the loadSharableLinkForFile method in the iOS Core SDK. Also, shareable links can be modified for different behaviors as noted here:
loadSharableLinkForFile
https://www.dropbox.com/help/201
The API doesn't offer a way to request Public links though, but in most cases one of the above methods should be suitable. (Not all accounts have Public folders anyway.)
Oh. Thanks a lot Greg. I did see loadStreamableURLForFile, however I imagined that it was for streaming video or other media content, and definitely not for images. Thanks for the help!
Going further, is there a plan for releasing the documentation of iOS Core APIs other than the tutorial? https://www.dropbox.com/developers/core/start/ios
I know it might not be very much required, but still helps a little. Thanks!
I don't know if there are plans for full documentation for the iOS Core SDK (as opposed to just what's in the header file now) but I'll send this along as a request.