Forum Discussion

wojwal_y's avatar
wojwal_y
Explorer | Level 3
4 years ago

Accessing Team Folders from User integration - and not Business Team integration

I'm trying to integrate with Dropbox Teams... The integration works fine... I can read/write to Team Folders. And write/read those team folders with Dropbox-API-Path-Root and a namespace of that team folder. But I just got another requirement.

 

The new requirement is actually not to use Team Administrator credentials... Which basically prevents me from using Dropbox Business Endpoints API at all.

 

In Dropbox business - when I use normal user integration with User Endpoints API all file operations happens in their team member (Purple) folder that normally in Dropbox is named as their Firstname/lastname.

So if a user in their Dropbox account has a folder structure like:

 

/John Doe/ (their team member folder)
/Team Folder1/
/Team Folder2/

 

And when I actually integrate with normal user API - Once writting/reading anything in their root folder "/" - I'm actually writting in their "/John Doe/" folder.

 

Question is: With this kind of API integration - can I write/read to Team folders that this user has access to somehow?

3 Replies

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

    Yes, even when an app is not connected to a team itself (i.e., it's not authorized by a team admin to access the Business API functionality), the app can still use the standard Dropbox API functionality to access any files/folders in the account, including the contents of any team folders/space (as long as it isn't sandboxed to an app folder).

     

    For instance, while it won't be able to the /2/team/team_folder/* endpoints, it can still use the /2/files/list_folder[/continue] endpoints (optionally with the "Dropbox-API-Path-Root" header if/as needed). When calling /2/files/list_folder, you can start with 'path' being the empty string "" to list the current root (which is determined by the "Dropbox-API-Path-Root" header, or lack thereof). I recommend reading the File Access Guide and Team Files Guide for information on navigating the Dropbox filesystem, including the different team space/team folder configurations. (The "Dropbox-API-Path-Root" header is required to access outside of the member folder.)

  • wojwal_y's avatar
    wojwal_y
    Explorer | Level 3
    4 years ago

    Hi Greg, 

     

    Yeah, I'm familliar with Dropbox-API-Path-Root - and use it with Business Team integration, but in order to use it:

     - I have to know the specific namespace ID, and in order to get it

     - I need to make team/namespaces/list call, which

     - requires me to use Team integration

     

    I just tried it, and it works like you suggested, it's just that I know the namespace id fro other team integration. 

     

    And my quesiton is - how can I do it just with normal user integration - without team integration at all. 

     

    Just thinking - would /sharing/ endpoints from users endpoints give me those Team Folders information/namespaces I'm looking for? Am I thinking right? Just want to make sure this can be done or not?

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

    Yes, there are a few ways you can navigate and determine the relevant namespace IDs without using team endpoints.

     

    For accounts with a team space, you can check /2/users/get_current_account to get the 'root_namespace_id'. Check out the Team Files Guide for information on that.

     

    For accounts without a team space, you can list everything under the member's folder, including mounted team folders, using /2/files/list_folder[/continue]. Or, you can use the sharing endpoints such as /2/sharing/list_folders[/continue] or /2/sharing/list_mountable_folders[/continue] to list mounted or unmounted team folders that the account has access to. These will also include shared folders, but you can use the returned metadata to check if any particular entry is a team folder.

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!