cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Tell us what you want to see on the Community here!
Close

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: 

Getting all files in a team drive

Highlighted

Getting all files in a team drive

New member | Level 2

Hi,

I would like to get all of the files in a Team Drive.

So far I have this - 

admin_member_id = self.get_admin_account_access_token().admin_profile.team_member_id
        headers = {}
        headers["Authorization"] = token
        headers["Dropbox-API-Select-User"] = admin_member_id
        headers["Content-Type"] = "application/json"

        url = dropbox_constants.DROPBOX_API_BASE + "sharing/list_folders"
        data = json.dumps({})

        res = requests.post(url, data=data, headers=headers)
        if not res.status_code == 200:
            return []
        content_json = json.loads(res.content)
        entries = content_json["entries"]

At this point, 'entries' holds shared folders metadata.

I couldn't find any way to retrieve list of files inside the folders out of this metadata.

Would appreciate any help

1 Reply 1
Highlighted

Re: Getting all files in a team drive

Dropboxer

The /2/sharing/list_folders[/continue] endpoints will return the list of shared folders themselves. To list the actual contents of any particular folder(s), you should use /2/files/list_folder[/continue]. I recommend reading the Content Access Guide for more information.

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?