Strange question here: I am working on an excel timesheet application for my company. Having searched a bit I can't seem to find anything on this topic and would like to get some feedback on feasibility.
What I currently do:
Our employees fill out a timesheet in excel which details some important information in addition to the hours they input for approval. Without incorporating Dropbox at the moment, this application only lets the employees input their hours and task details and when they have validated their own hours, they can submit their timesheet for approval. What the application currently does is lock the workbook and copy it to a folder where a manager can review and approve the timesheet. Obviously, the employee shouldn't be able to write to this 'pending' timesheet any further. Currently, it is programatically locked so they can't change anything.
What I'd like to do in Dropbox
Ideally, I would like to have all of these timesheets on Dropbox with shared folders isolating each employee. They would fill out their tasks/hours, and when they press the button in excel to submit for approval, some code would ping Dropbox's API and copy a copy the file to a folder the employee would not be able to read/write to. This is the crux of my question: Is it possible to use dropbox's API to push files from one place where a user has read/write access to another place where the user does not have access at all? In this way, when a timesheet is submitted, there is a 'safe' copy in a place an employee can no longer even see it let alone modify it and this is stored safely in the cloud.
I should clarify that the place the employee's timesheets would be sent on dropbox would be a common "Pending Approval" folder that would be the end point for all employee's submitted timesheets.
From a feasibility perspective, does Dropbox's API currently support this kind of data mobility? If so, could I please be given some information on which methods would be necessary to accomplish this?
Thank you very much!
... View more
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!
... View more
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:
the .exe checks to see if an access token for a new user exists in the program's local cache on the user's PC.
If no access token is found, it asks the user to log into Dropbox through a web browser, accept access to the app (using the app's key), and get an authorization token.
The user then copys and pastes this authorization token into a text prompt the .exe provides.
This authorization token is then exchanged with the app's secret key to obtain an access token for that user which is stored locally for future logins on the user's PC.
If this is successful, the user only has to do this one time and henceforth will go straight into the .exe without needing to do any more OAuth on their part.
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
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!
... View more