I'm just starting out with the Dropbox API and am trying to just see all my files that I had manually uploaded to my account. I enabled all permissions for my access token just to be sure. However, my script below shows that my account is empty. But there are several files uploaded when I view the web ui. Here is my script. Could someone please point me in the right direction?
import dropbox
# Initialize a Dropbox client instance
dbx = dropbox.Dropbox('ACCESS_TOKEN')
acct = dbx.users_get_current_account()
def list_files(path=''):
try:
result = dbx.files_list_folder(path)
print(result)
for entry in result.entries:
print(entry)
if isinstance(entry, dropbox.files.FileMetadata):
share_link = dbx.sharing_create_shared_link_with_settings(entry.path_lower).url
print(f'{entry.name}: {share_link}')
elif isinstance(entry, dropbox.files.FolderMetadata):
list_files(entry.path_lower) # Recursive call for folders
except Exception as e:
print(f'Exception: {e}')
# Call the function to list files and get share links
path = '/production'
list_files(path)