cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Share your feedback on the Document Scanning Experience in the Dropbox App right here.

Discuss Dropbox Developer & API

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: I can't access newly created folders via API

I can't access newly created folders via API

_shintaku_
Explorer | Level 3
Go to solution

I am using Dropbox for Python (https://dropbox-sdk-python.readthedocs.io/en/latest/index.html). However, I realized that the script doesn't retrieve newly created folders. The script is like this....

 

client = dropbox.Dropbox(DROPBOX_ACCESS_TOKEN)

file_list = client.files_list_folder(r'', recursive=True )

myfolders = [x.name for x in file_list.entries if 'size' not in dir(x)]

print(myfolders)

 

This script gave the same problem on both 'App folder' and 'Full Dropbox' as suggested on this thread: https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/API-can-t-see-new-files-in-APP-folder/t...

 

 

1 Accepted Solution

Accepted Solutions

Здравко
Legendary | Level 20
Go to solution

Hi @_shintaku_,

Did you try to continue pagination using 'files_list_folder_continue'? 🧐 If not, give it a try. :winking_face:

By the way.. 'if 'size' not in dir(x)' ..statement is not very stable. Better use 'type(x) is '...

Hope this helps.

 

View solution in original post

3 Replies 3

Здравко
Legendary | Level 20
Go to solution

Hi @_shintaku_,

Did you try to continue pagination using 'files_list_folder_continue'? 🧐 If not, give it a try. :winking_face:

By the way.. 'if 'size' not in dir(x)' ..statement is not very stable. Better use 'type(x) is '...

Hope this helps.

 

_shintaku_
Explorer | Level 3
Go to solution

Thank you @Здравко, you solution solved it.

Greg-DB
Dropbox Staff
Go to solution

@_shintaku_ You're not guaranteed to get everything back in one call to files_list_folder, so as Здравко indicated, make sure you implement files_list_folder_continue in addition to files_list_folder as documented.

 

Also, here's an example of how you can check the type of a Metadata object.

Need more support?