Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Good morning,
I have been developing an app for my company that uses Dropbox to store some files that should be read/written to when the user uses the auto-py-to-exe .exe I've made that is locally installed on our user's computers. This is my first time using Dropbox's API so the finer points may have been lost so please be patient!
What I'm trying to do:
When a user opens my .exe, an access token for that user is generated using the OAuth flow as I understand it:
This has been successful and the authorization tokens and access tokens seem to be generating valid dropbox.dropbox(<access code>) objects. I can query these objects for different users and see that the tokens are valid for the app key/secret pair the .exe parses. My understanding is that this access token is tied directly to the app on Dropbox. As in; the root path for searching for files is the root path of the app itself: <Dropbox>/Apps/<My App>/. This should be the same for every user who makes a call to the API using the access token that is generated and saved.
Next, I have my .exe copy files from my /app/ folder on Dropbox locally and create a backup. I do this to limit the number of API calls my .exe has to do and allows the user to have a file from the /app/ and have a copy of their version. When the user is finished, I have the user commit the file back to Dropbox if they've done any changes.
What is not working?
My .exe does not find any files when users other than myself generate access tokens. During debugging, I am able to call
DBX.files_list_folder(path="")
for my access token and obtain every file/folder in my <Dropbox>/Apps/<My App> folder. Further, my .exe works as designed using my access token.
When others use the program (or in my case during debugging, I use a different dropbox account to get an access token not associated with my 'developer's' account) the files_list_folder(path="") returns with no files found. Namely, I get an empty list for "entries", a cursor (a giant string), and the has_more property being False.
I'm running the exact same code for different access tokens and getting different results. The only thing that seems to be different is that it works when the access token provided points to my personal account (who owns the app in Dropbox) so this is what I suspect the problem is.
I'm at a loss. Is there something obvious I'm missing as to why other users who successfully have access to my App via OAuth can't see or obtain the files in the App folder they are making calls through? I should note that on dropbox my app is in "Development" status and I don't want to go through the process of getting into "Production" status given the very small number of users. Could this be the reason why no one can access these files?
Thanks for any and all information anybody can provide!
Thanks for the detailed question! The "development"/"production" status wouldn't be the issue here, and most of the rest of your understanding is correct. (And if you don't need to connect to more than 50 users, you don't need production status regardless.)
It sounds like the issue here is that each user receives their own distinct "app folder". When a user authorizes an app with the "app folder" permission to access their account. Dropbox automatically creates a new app folder in the user's account. Dropbox then returns an access token specific to that app-user pair, which will only allow access to that user's own app folder. Each app folder starts empty, and the app folders for different users do not sync with each other.
If you want to start each user out with some content in their app folder, you'd need to have the app upload that file content when they first connect to the app.
Or, if you want all users of your app to connect to the same content and have that sync, you'd instead need to register and use an app with the "full Dropbox" permission and invite all of the users to a single shared folder that you've previously configured for them. Apps with the "full Dropbox" permission don't get app folders, and can instead access anything in the connected accounts, such as shared folders.
Thanks for the detailed question! The "development"/"production" status wouldn't be the issue here, and most of the rest of your understanding is correct. (And if you don't need to connect to more than 50 users, you don't need production status regardless.)
It sounds like the issue here is that each user receives their own distinct "app folder". When a user authorizes an app with the "app folder" permission to access their account. Dropbox automatically creates a new app folder in the user's account. Dropbox then returns an access token specific to that app-user pair, which will only allow access to that user's own app folder. Each app folder starts empty, and the app folders for different users do not sync with each other.
If you want to start each user out with some content in their app folder, you'd need to have the app upload that file content when they first connect to the app.
Or, if you want all users of your app to connect to the same content and have that sync, you'd instead need to register and use an app with the "full Dropbox" permission and invite all of the users to a single shared folder that you've previously configured for them. Apps with the "full Dropbox" permission don't get app folders, and can instead access anything in the connected accounts, such as shared folders.
Hello Greg,
That was precisely the problem. I had the app registered without the full dropbox permission. Almost certainly what you said was occurring; each user who logged in was using access tokens pointing to their OWN app folders which obviously had no files in it.
Thank you very much, you've saved an absolute ton of time for me today. Have a great weekend!
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
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!