Your workflow is unique 👨‍💻 -  tell us how you use Dropbox here.

Forum Discussion

Rashti's avatar
Rashti
New member | Level 2
7 years ago

Getting all files in a team drive

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

About Dropbox API Support and Feedback

Node avatar for Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.

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, Facebook or Instagram.

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!