You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
APIs
12 TopicsDropbox API - check_and_refresh_access_token
I have a valid app_key, app_secret, and refresh_token and I'm trying to call the check_and_refresh_access_token function in the Dropbox API for Python. Here is the code... def refresh_dropbox_token(app_key, app_secret, refresh_token): dbx = dropbox.Dropbox( oauth2_refresh_token=refresh_token, app_key=app_key, app_secret=app_secret, ) token = dbx.check_and_refresh_access_token() if token: return token.access_token else: raise Exception("Failed to refresh access token.") In the debugger when I examine the token variable it has the value of nothing. Just to make sure I was passing a valid refresh_token, I called this with the refresh_token received in a full oauth2 authorization process. Any ideas on what may be wrong here? Once I do the full authorization I am able to upload files through the API, but when it expires, I want to use the refresh_token rather than taking the user back to Dropbox to authorize again. Any help on this would be greatly appreciated! Bob59Views0likes3CommentsSlow response using Dropbox for Python
Hello, My python code has been working well for months. Within the past 48 hours, the files_download command in the snippet below (with tokens obfuscated) has started to take about 45 seconds while previously it was instantaneous. It is the last line that is the culprit. import dropbox DROPBOX_APP_KEY = "?????" DROPBOX_APP_SECRET = "?????" DROPBOX_REFRESH_TOKEN = "????" dbx = dropbox.Dropbox(app_key=DROPBOX_APP_KEY, app_secret=DROPBOX_APP_SECRET, oauth2_refresh_token=DROPBOX_REFRESH_TOKEN) metadata, f = dbx.files_download('/alerts.csv') Any suggestions? With thanks, David124Views0likes6CommentsAuthError 'invalid_access_token' with Python SDK after Token Refresh
Dear Dropbox Developer Team, I have been using the Dropbox API with your Python SDK for approximately four years without any issues. However, since November 25th or December 1st, I started encountering AuthError exceptions related to invalid access tokens. My implementation has remained unchanged during this time. I store tokens in a database and update them whenever the SDK retrieves a fresh one. Here is the relevant code snippet: After refreshing the access token using check_and_refresh_access_token(), subsequent requests (such as to files_list_folder or files_get_temporary_link) proceed without issue. However, when a new instance of DBXManager is created and the token is still valid (i.e., not expired and therefore not refreshed), requests may fail with the following error: dropbox.exceptions.AuthError: AuthError('a5dae06f271b404296dc9d254e75eb47', AuthError('invalid_access_token', None)) The only way to resolve this issue is to refresh the token again. As a temporary workaround, I am manually adjusting the token expiration in the database to force a refresh on the next instance creation. I am trying to understand the root cause of this behavior: Was there any recent change to the Dropbox backend or API behavior that could explain this issue? If this is a problem on my end, could you help clarify why the same implementation worked flawlessly for years? Thank you for your assistance. Please let me know if you need additional details about my setup or logs.Solved47Views0likes3CommentsHow get notified if automation was successful/failed?
I have an Automated Folder that converts the uploaded file to PDF and saves it. I am using Dropbox API for it. Is there a way for me to programmatically check whether/when the PDF file generated by the automation is available? How should one go about it?23Views0likes1CommentUpload multiple files in session
Backstory I have a bunch of small PDFs (18 kb each). filesUpload worked until I understood that a `429` is quite usual. Researched and found the batch endpoints. I wanted to use `/upload_session/start_batch`, `/upload_session/append_batch` & `/upload_session/finish_batch` to upload all files in a session. For stability I used the JS SDK.....but there is no method for `/upload_session/append_batch` 🧐 I created my own method and used the endpoint directly.....worked. But I got errors in the `finish_batch` Then I thought: If the file size off all PDFs is so small, maybe I can upload them directly in the `start` without any `append` and without batch session. I thought, I can use the one `session_id` returned by the `filesUploadSessionStart` method and then go with `filesUploadSessionFinishBatchV2` and split the uploaded file into the original PDFs. const allContent = concatArrayBuffers(...files.map(({ contents }) => contents)); const startResponse = await dbx.filesUploadSessionStart({ close: true, contents: allContent, }); const batchData = files.reduce( (acc, cur) => { acc.entries.push({ cursor: { session_id: startResponse.result.session_id, offset: acc.offset, }, commit: { autorename: true, mode: "add", mute: false, path: cur.path, }, }); acc.offset += cur.contents.byteLength; return acc; }, { offset: 0, entries: [], } ).entries; await dbx.filesUploadSessionFinishBatchV2({ entries: batchData.map(({ commit, cursor }) => ({ commit, cursor })), }); This is the code. Questions What is a session exactly? What is an entry exactly? Can I access one session from multiple entries in a `filesUploadSessionFinishBatchV2`? Where am I going wrong?62Views0likes4CommentsEmbedding an Editable Excel Sheet from Dropbox with Sticky Headers and Indices on a Website
Hi everyone, I'm looking for a way to embed an Excel sheet (stored on Dropbox) onto my website, with sticky columns and row indices (like in Excel's Freeze Panes feature) that function across all screen sizes. The embedded sheet itself should be editable. Has anyone successfully implemented something like this? Any tips on tools, libraries, or approaches would be greatly appreciated. Thanks in advance!51Views0likes3CommentsAudit Log API Sorting
Hello, I'm trying to use Dropbox Events/Audit Log but the feed is a bit weird, it somewhat follows ascending order, I want to get the events in Descending order, but I'm unable to find any parameter that can allow me to do that, do you know a way to do this? your help is highly appreciated! Best27Views0likes1CommentShare_folder endpoint returning too_many_mounts/tree_size_exceeded
An operation that worked perfectly fine before now returns the following error: makeDropboxRequest: https://api.dropboxapi.com/2/sharing/share_folder Error making Dropbox request: too_many_mounts/tree_size_exceeded/ Network error making request to https://api.dropboxapi.com/2/sharing/share_folder: Error: too_many_mounts/tree_size_exceeded/ The process leading up to this error: 1-4 subfolders are created, of which the parent (main) folder housing those 4 subfolders is shared so that groups can be assigned to have access to it. Other than that the folder is empty, and the subfolders are empty as well. This never happened before, so I'd like to know what changed so that we can apply a workaround.68Views0likes3CommentsDBChooser for iOS - how to build locally
Hi, I have been using the DBChooser framework in my app for a few years and it's been working fine, until iOS18 came out and now it fails to open the Dropbox app when invoked, with this message: BUG IN CLIENT OF UIKIT: The caller of UIApplication.openURL(_:) needs to migrate to the non-deprecated UIApplication.open(_:options:completionHandler:). Seeing that DBChooser has been 'deprecated' on the Dropbox developer website, and that the Github repo hasn't been updated in 11 years, I thought I'd at least be able to download the code on my Mac and then be able to build the framework locally, and possibly fix some of the deprecation issues. Unfortunately the downloaded project fails to compile on my Mac. The error I get is in the 'Run Script' phase: accessing build database "/Users/myname/Library/Developer/Xcode/DerivedData/DBChooser-colttgencgxlykfovqhahsshavkt/Build/Intermediates.noindex/XCBuildData/build.db": database is locked Possibly there are two concurrent builds running in the same filesystem location. Can anyone help me figure this out? I am using Xcode 16.1, running macOS 15.1.54Views0likes4Comments