Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
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)
@soubriquet wrote: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. ...
... # Call the function to list files and get share links path = '/production' list_files(path)
Hi @soubriquet,
Hm...🤔 Are "all your files" stored in "production" folder? 🧐
If so, you didn't mention any error output encountered or account type in use (some account types may have different roots). If you are still in confusion, post a screenshot of browser view showing uploaded files you're talking about and the full output of your code. Dump also the content of 'acct' (while hiding the personal information).
Hope this gives direction.
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!