Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

Madhavi T.'s avatar
Madhavi T.
Explorer | Level 4
9 years ago

Dropbox API List Folders

Hi there,

 

As a part of my POC, I need to check in a user's account if a particular folder is present or not. If not, then I need to create that folder in the user's account. I am having admin account in Business Dropbox and I am able to list folders for my account, using the below user endpoint, passing my access token having Full Dropbox access,where I can maniuplate the output.

 

https://api.dropboxapi.com/2/files/list_folder

 

My question is, how can I check the list of folders in another account and then create the folder if it doesnot exist. Would it require Business endpoints/token of app with 'Team Information' access. Also, would 'create folder' API (https://api.dropboxapi.com/2/files/create_folder) work for that account or only for my account. 

 

Thanks in advance.

 

-Madhavi

2 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    9 years ago

    You can do this using either type of app.

     

    For a normal (not Business) Dropbox API app, the app gets connected to individual user accounts. When you connect a user account, the app gets an access token for that particular account. Using that token, both /2/files/list_folder and /2/files/create_folder will operate on that particular account. To operate on a different account, that other user will need to connect the app to their account, giving the app a different access token.

     

    For a Dropbox Business API app, the app gets connected to teams entirely. If the app has the "team member file access" permission, it can use the "member file access" feature to access the account of any member of the team, e.g., to use /2/files/list_folder and /2/files/create_folder for that member.

     

    Also, note that in either case, you can use use /2/files/get_metadata instead of /2/files/list_folder if you just want to know if a specific path already exists.

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

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!