cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to know what we learned at IBC? Check out our learnings on media, remote working and more right here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

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

file list from shared folder dropbox rest api python

file list from shared folder dropbox rest api python

venkate
Explorer | Level 3
Go to solution

I need to create a data frame out of attributes and share URL of all the files in a directory and its sub-directories

the code am using is 

for entry in dbx.files_list_folder('/2.info_copy',recursive=True).entries:
  if(str(type(dbx.files_get_metadata(entry.path_lower))) == "<class 'dropbox.files.FileMetadata'>"😞
      shared_link_metadata = dbx.sharing_create_shared_link(entry.path_lower)
      d.append(
        {
            'Name': entry.name,
            'Folder Path': entry.path_lower,
            'Link': shared_link_metadata.url,
            'client_modified' : str(entry.client_modified),
            'server_modified' : str(entry.server_modified),
            'size' : entry.size,
            'content_hash' : entry.content_hash

        })


df = pd.DataFrame(d)
 
I am new to the dropbox API and not sure if can get the list of files from the shared folder.

 

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

You can use the API to list the files in any folder in the connected account, whether or not the folder is shared. I recommend reading the File Access Guide and Team Files Guide for reference.

 

Looking at your code, there are a few things to note:

 

View solution in original post

3 Replies 3

Greg-DB
Dropbox Staff
Go to solution

You can use the API to list the files in any folder in the connected account, whether or not the folder is shared. I recommend reading the File Access Guide and Team Files Guide for reference.

 

Looking at your code, there are a few things to note:

 

sakoht
Explorer | Level 3
Go to solution

It would be really great to see the snip of code that actually accomplishes what the OP describes above.  Pointing to the manual is way less helpful, as it spends a bunch of time on abstractions.  Please just show the code?   You have to do DropboxTeam() instead of Dropbox().  The methods are different.  Listing things gives back an object that isn't iterable, doesn't seem to contain a list.  This may be obvious to someone ...but not to someone who didn't write it.

sakoht
Explorer | Level 3
Go to solution

This StackOverflow has a code snip:

 

https://stackoverflow.com/questions/59877833/download-files-from-dropbox-team-folder-using-python-sd...

 

If this has to be this complicated to list the top-level of a team folder, it would be great to have it somewhere clearly visible in the docs as an example!

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    sakoht Explorer | Level 3
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?