Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
mbm123
5 years agoExplorer | Level 4
Access without an "app"
Hey, I was wondering if it is possible to access a dropbox account without the token generated in the app console. What I mean is, can I use an api on my python script that will query an input drop...
- 5 years ago
Yes, that's correct.
mbm123
5 years agoExplorer | Level 4
So it should be possible for me to ask a user to register with username and password, redirect it as a query for dropbox in order to generate a permanent token, save this token and use it later to download/upload files for this user?
could this operation be restricted to a specific path?
for example, if i want to share FAMILY folder from my dropbox (/FAMILY/), and do so for my other family members, they just need to "login" on my webpage with their dropbox credentials, then i do the token thing mentioned above?
Greg-DB
Dropbox Community Moderator
5 years agombm123 Assuming you're referring to the username/password for your own app (that is, your app should never request or handle Dropbox username/passwords directly), yes, you can have the user log in to your own app, and then send them through the Dropbox app authorization flow to request access to their Dropbox account. Once they do so, you would use the resulting access token/optional refresh token to later make API calls for their account, such as to upload/download files.
(Note that if you only need to access your own account, you could just use your own access/refresh token instead of having each user add the shared folder to their own account and authorize the app to access their account. Note that you shouldn't expose your access/refresh token to other users though, so in this case you should make sure to only keep the token(s) on the server and not exposed to the client.)
Dropbox does not offer the ability to grant an app/access token access to specific existing folder(s) only, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.
For reference, the "Dropbox API" currently offers two levels of file access: "app folder" and "full Dropbox". Access tokens for apps with the app folder access type can only access the contents of the special app folder created for the app in the connected account. App folders can't be set to existing folders or combined with shared folders or team folders though.
Access tokens for apps with the full Dropbox access can access anything in the connected account, including shared folders. You can find more information about the different permissions here.
- mbm1235 years agoExplorer | Level 4
That's a lot of information, thank you very much, also for the initiative to forward my humble suggestion.
I will get more familiar with the api and the documentation you linked and further this discussion (or open a new thread?) once deeper questions arouse.
Thank you once again.
- mbm1235 years agoExplorer | Level 4
Hey again.
I read through some API (python) and managed to create an app, generate my personal token and send file requests to dropbox.
That's nice, but I would like to be able to ask for username/password, instead of redirecting a user to the token page.
I found this example:
https://github.com/dropbox/dropbox-sdk-python/blob/main/example/oauth/commandline-oauth.py
tl;dr
in the example it asks the user to:
print("1. Go to: " + authorize_url)
print("2. Click \"Allow\" (you might have to log in first).")
print("3. Copy the authorization code.")
Seems kind of silly, why can't i do it for the user with username/password?
I hope I made myself clear, I tried 🙂
- mbm1235 years agoExplorer | Level 4
I understand, so I cannot (and should not) ask the user for username/password and "do it myself" for the user.
I can open the link to the token generation, where the user will login and generate a code, which he would then pass to me, and revoke in case he wishes to cease the communication.
I got it right?
- Greg-DB5 years ago
Dropbox Community Moderator
Yes, that's correct.
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!