I am new to Dropbox API and creating a Python app for a publicly shared link. I want to get a list of files and folders and their modified date present in the said publicly shared link. I am looking for something similar to "files_list_folder" in terms of functionality. Thanks.
1 Answer
[Cross-linking for reference: https://www.dropboxforum.com/t5/API-support/How-to-get-a-list-of-files-and-folders-present-in-a-publicly/m-p/257852#M14954 ]
You can actually use files_list_folder itself to list the contents of a shared link for a folder. To do so, you should use the shared_link parameter. That would look like this:
import dropbox
dbx = dropbox.Dropbox("<ACCESS_TOKEN>")
url = "https://www.dropbox.com/sh/..."
shared_link = dropbox.files.SharedLink(url=url)
print(dbx.files_list_folder(path="", shared_link=shared_link))
-
This no longer works, I am getting the following error: ApiError: ApiError('..', ListFolderError('path', LookupError('not_found', None)))– DBaCommented Oct 2, 2019 at 11:48
-
2@DBa I just tried it again, and confirmed that the method still works. If you're getting a
not_founderror, that can indicate that you're supplying an incorrect URL and/or path. I see you also posted this on the forum so I'll follow up with you there: dropboxforum.com/t5/Discuss-Developer-API/…– GregCommented Oct 2, 2019 at 17:40