Retrieve contents of a public Dropbox folder?

Sam picture Sam · Mar 19, 2012 · Viewed 19.8k times · Source

Is there a way to retrieve a list of the contents of a public Dropbox folder (preferably in PHP)? This is what a URL to a public file in Dropbox looks like:

http://dl.dropbox.com/u/1234567/publikPholder/textytext.txt

One would think that jumping up one level to the directory in the URL...

http://dl.dropbox.com/u/1234567/publikPholder/

...would show all the public files. Nope. Nothing but a 404.

Answer

chrisn picture chrisn · Mar 19, 2012

Looks like this library is pretty complete (although I haven't used it myself), and is probably as simple as (post-auth):

$info = $dropbox->getMetaData('Public', true);
print_r($info['contents']);