We Want to Hear From You! What Do You Want to See on the Community? Tell us here!
Forum Discussion
soubriquet
2 years agoNew member | Level 2
API Cannot Find Any Files
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)
1 Reply
- Здравко2 years agoLegendary | Level 20
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.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,036 PostsLatest Activity: 9 hours ago
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If 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!