Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
Paul W.79
11 years agoNew member | Level 1
Webpage that lists contents of shared, public dropbox folder
I'd like to be able to add files into a shared Dropbox folder, and then have my website be able to list and download the contents of that shared dropbox folder.
So I don't want there to have to be a user authentication flow. I don't need to access the folders/files of various users. I just need to be able to access the content of this one folder.
I want my server to be able to list the contents of this one shared folder, with the authentication process happening entirely on the server, and then display that via a webpage. Then if a user clicks on a specific file, it will download that file, once again, without having to go through a user interactive authentication process.
All the examples I see require user input for authentication to access all the contents of one users Dropbox folder. Are there any examples doing just what I'm saying, preferably with the Java SDK (or javascript/node)?
4 Replies
Replies have been turned off for this discussion
- Greg-DB11 years ago
Dropbox Community Moderator
[Cross-linking for reference: https://stackoverflow.com/questions/32030105/dropbox-api-listing-content-of-shared-public-folder ]
The API was designed with the intention that each user would link their own Dropbox account, in order to interact with their own files. However, it is technically possible to connect to just one account. The SDKs don't offer explicit support for it and we don't recommend doing so, for various technical and security reasons. Most of these concerns are allayed for server-side apps though, where you can protect the access token server-side.
So if you did want to go this route, instead of kicking off the authorization flow, you would manually use an existing access token for your account. (Just be careful not to revoke it, e.g. via https://www.dropbox.com/account/security .)
For example, using the Java SDK, you could initialize a client using a hard coded access token for your own account using this constructor.
From there you can make the normal calls to list and download files.
- Paul W.7911 years agoNew member | Level 1
fyi for others - access token can be generated following instructions here: https://blogs.dropbox.com/developers/2014/05/generate-an-access-token-for-your-own-account/
- Paul W.7911 years agoNew member | Level 1
Will the access token last indefinitely if it is never revoked on my end?
- Greg-DB11 years ago
Dropbox Community Moderator
Yes, OAuth 2 access tokens for the Dropbox API, including those generated from the App Console, don't expire by themselves.
About 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!