Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Hello!
I am currently saving files in my 'Apps' folder using the files_upload() API. I want to save files in a seperate environment than 'Apps' where users are already looking. I believe my Dropbox key has permission to do this, but I cannot figure out the path settings to get this to integrate correctly.
folder = 'testing'
filename = 'test_12_28_23'
path = '/AccountingCloseoutFiles/' + folder + '/' + filename
myRange = np.arange(1,1001,1)
df = pd.DataFrame({"numbers": myRange})
try:
with io.BytesIO() as stream:
with pd.ExcelWriter(stream) as writer:
df.to_excel(writer, sheet_name='test',
index=False)
stream.seek(0)
dbx.files_upload(stream.getvalue(),
path,
mode=dropbox.files.WriteMode.overwrite)
except Exception as e:
logger.critical('File was unable to be saved to dropbox.')
logger.critical(f'Error: {e}')
sys.exit(1)
This code works, but it stores data in 'Apps' instead of the 'AccoutingCloseoutFiles' parent folder that I want it in.
Any help is appreciated!
Hi @ms97,
No, your application doesn't have such permission. You have limited your application permission to access (not only save) files and/or folders within app specific folder only and nothing outside. That's your choice! As seems, this choice is unintentional. You need full access application, not app' folder type! Unfortunately, such permission cannot get changed (unlike other permissions, like scopes, for instance). You need to recreate your application and select correct application type at creation moment (as noted, later cannot change).
Hope this helps.
@ms97 Здравко is correct; you cannot change the access type ("app folder" versus "full Dropbox") on an existing app. You can find more information on access types here. You can register a new app with full Dropbox access here.
Thank you for the information! My app has full Dropbox access already, but no matter what path I give it, it is stored in the App folder. I have two apps one is limited to 'App folder' and one is not. When using bi_automation, it still only stores files inside the app folder. Is there a way to change this?
@ms97 wrote:... When using bi_automation, it still only stores files inside the app folder. ...
What do you mean when you say "using bi_automation"? 🤔 Did you change only the app key only and continue use the existing tokens or perform full re-authentication? 🙂
I did a full re authentification using a new app
@ms97 If you perform an upload using the Dropbox API and it is automatically rooted in the app folder, that means you are using an access token for the app for that app folder.
Registering and authorizing a new app with full Dropbox access won't change existing access tokens (or refresh tokens); existing access tokens (and refresh tokens) for the app folder app will continue to only have access to the app folder. To upload outside the app folder, you'd need to switch to using an access token for the full Dropbox app instead.
To address this, get an access token (and refresh token, if using) for the full Dropbox app, and update your app as needed to make sure that it is using an access token (and refresh token, if using) for the full Dropbox app in the creation of the 'dbx' object that you're using to perform the upload.
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!