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.
Forum Discussion
Nellyb43
4 years agoHelpful | Level 6
Dropbox API Creating Shared link settings Error.
I have a program in Python 3.9 which cleans data every morning, creates a final dataset, and then uses the dropbox api to create a shared link with settings (password) for the file, then email that l...
- 4 years ago
Very interesting. Do you recommend I upload the file straight to dropbox using the API over using util to simply copy it over from my local directory?
I arbitrarily chose 60 seconds of time to give dropbox time to fully sync up the file in the application folder. Each file is on average 500MB. Do you recommend I go with a longer length of time just to make sure the sync works with sharing no matter what. One minute here and there is no issue.
Greg-DB
Dropbox Staff
A 'path/not_found' error like this indicates that creating the shared link failed because there was nothing found at the specified path to link to. In this case, based on the error output, this is referring to the path you're supplying in your 'dailyfile_csv' variable.
You'll need to check why there isn't anything at that path. Perhaps you meant to upload something there, but didn't do so successfully. Or, perhaps your 'dailyfile_csv' value is just incorrect.
Nellyb43
4 years agoHelpful | Level 6
So I ended up finding a fix for this by having my program wait 60 seconds with time.sleep(60) and somehow the sharing works perfectly again.
Please correct me if I am wrong but I am guessing the sync for the app folder is not instantaneous, especially due to the massive size of the files I attempt to share. Since the sync needs some time, I add a waiting period of a minute in order to ensure that the big file has been transferred and synced from my internal folders to the dropbox app folder.
- Greg-DB4 years agoDropbox Staff
Right, uploads are not instantaneous. Given your description, it looks like you're writing to the local filesystem and are relying on the Dropbox desktop client to upload the file to Dropbox. The file needs to be uploaded to Dropbox, not just written to the local filesystem, before sharing_create_shared_link_with_settings will work for it.
So, your API sharing_create_shared_link_with_settings code was apparently running before the file was actually uploaded, which would lead to the error. (This could happen when the upload takes a bit of time, or if the client isn't running, etc.)
You can also use other API methods such as files_get_metadata or files_list_folder/files_list_folder_continue to check what files exist on Dropbox first.
- Nellyb434 years agoHelpful | Level 6
Very interesting. Do you recommend I upload the file straight to dropbox using the API over using util to simply copy it over from my local directory?
I arbitrarily chose 60 seconds of time to give dropbox time to fully sync up the file in the application folder. Each file is on average 500MB. Do you recommend I go with a longer length of time just to make sure the sync works with sharing no matter what. One minute here and there is no issue.
- Greg-DB4 years agoDropbox Staff
You can certainly use the API to upload files instead (files_upload for files smaller than 150 MB, or upload sessions otherwise). That would be helpful in that the code would directly know when the file is completely uploaded.
That's not strictly necessary though. You can use other functionality on the API to detect changes, e.g., to determine when the file is uploaded. Check out the Detecting Changes Guide for more information.
In any case, I wouldn't recommend just waiting some amount of time, as that could be unreliable.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,910 PostsLatest Activity: 3 days agoIf you need more help you can view your support options (expected response time for an email or 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!