Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
I have an container-based AWS Lambda that reads from S3 and writes to Dropbox. It has worked for months and it quit working on Saturday (2023-11-17) morning.
Given two folders and paths
using python, when I call
files_upload(b'data', 'My Team/folder01/folder02/filename.txt')
to write a file:
1. it used to write the file: `My Team/folder01/folder02/filename.txt`
2. now it writes the file: `Some User/My Team/folder01/folder02/filename.txt`
After much reading, I have discovered that I need to set the path root for the "team" rather than the "member" or user.
I am now doing that with the following two lines:
root_namespace_id = dbx.users_get_current_account().root_info.root_namespace_id
dbx = dbx.with_path_root(dropbox.common.PathRoot.root(root_namespace_id))
this works great locally on my development computer, but when I add the two lines to my AWS Lambda logic, it appears to be ignored when I execute it remotely.
Given the following four lines:
dbx = DropboxTeam(DROPBOX_ACCESS_TOKEN).as_user(DROPBOX_TEAM_USER)
root_namespace_id = dbx.users_get_current_account().root_info.root_namespace_id
dbx = dbx.with_path_root(dropbox.common.PathRoot.root(root_namespace_id))
metadata = dbx.files_upload(b'data', 'My Team/folder01/folder02/filename.txt')
If I execute those four lines on my local computer the files write to the expected (team) folder
My Team/folder01/folder02/filename.txt
If my AWS Lambda executes those four lines, it writes to the user/member folder
Some User/My Team/folder01/folder02/filename.txt
I have logged out the
root_namespace_id
it is the same, both locally and remotely
The only thing I see in the metadata is that
Locally:
Remotely:
Do I need to do something special when making this call in an AWS Lambda?
Hello,
There is nothing special, or different, that needs to be done when running code in AWS Lambda from the Dropbox side. If it's working locally (in dev), it should work remotely (on a server). Are you able to re-confirm that the same exact code is being run in both environments?
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!