Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
I'm trying to make a simple web app that will list contents on one particular shared folder. There is about 200 small excel files in that folder and the app would like to download those files and do some magic on them.
I was able to list all files with:
dbx.filesListFolder({ path: "/some path", include_media_info: true, shared_link: { url: "https://www.dropbox.com/sh/id_or_whatever/another_random_string?dl=0" } })
Now I would like to download all the files and do something with them.
I tried `filesDownloadZip` but it rejected path in form of "id:asdfasdf" where asdfasddf is a string I got from parent_shared_folder_id
`filesDownload` throws the same error. Other posts on this forum mentioned `sharingGetSharedLinkFile` but that requires some kind of preview link.
Thanks in advance.
You can use filesDownloadZip (for an entire folder) or filesDownload (for a specific file) if the file/folder is in the account that you're connected to (i.e., for the access token you're using). In that case, the 'id' should just be the 'id' property returned in the relevant FilesFileMetadata or FilesFolderMetadata object you got from filesListFolder. You should not try to construct that value yourself. (The 'parent_shared_folder_id' is a different kind of ID.) Likewise, if the folder is in the connected account, you can list the contents using filesListFolder/filesListFolderContinue without passing in the shared link, by instead just using the relevant path in the account.
If the content is not in the connected account though, you will need to instead use sharingGetSharedLinkFile instead, like you mentioned. You do need to pass in the 'url' and 'path' in that case, but the 'url' in that case is the same "https://www.dropbox.com/sh/..." you used originally.
You can use filesDownloadZip (for an entire folder) or filesDownload (for a specific file) if the file/folder is in the account that you're connected to (i.e., for the access token you're using). In that case, the 'id' should just be the 'id' property returned in the relevant FilesFileMetadata or FilesFolderMetadata object you got from filesListFolder. You should not try to construct that value yourself. (The 'parent_shared_folder_id' is a different kind of ID.) Likewise, if the folder is in the connected account, you can list the contents using filesListFolder/filesListFolderContinue without passing in the shared link, by instead just using the relevant path in the account.
If the content is not in the connected account though, you will need to instead use sharingGetSharedLinkFile instead, like you mentioned. You do need to pass in the 'url' and 'path' in that case, but the 'url' in that case is the same "https://www.dropbox.com/sh/..." you used originally.
Cool, Thanks a lot, Greg.
Have a wonderful day.
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 Twitter or Facebook.
For more info on available support options, see this article.
If you found the answer to your question, please 'like' the post to say thanks to the user!