Announcements
Do you have an idea for Dropbox Paper? Share it with us here!

is_team_folder returns false for team folders

Explorer | Level 4

I'm using DropBox Business Standard. The top level team space is My Team. Within that is a folder name WIP Folder. The list_folders API command shows that WIP Folder is not a team folder as is_team_folder is set to false. WIP Folder is a team folder though, it has the team folder icon referenced here:

https://help.dropbox.com/teams-admins/team-member/team-folders

In fact every folder returns "is_team_folder": false, I'm just using WIP Folder as an example. Here's the list_folders output.

Ehy is it not "is_team_folder": true?

{
      "access_type": {
        ".tag": "editor"
      },
      "is_inside_team_folder": true,
      "is_team_folder": false,
      "owner_team": {
        "id": "dbtid:AACFOnUrcjz66yWgLJTSWqQf0kuygwfhieh",
        "name": "My Team"
      },
      "parent_folder_name": "",
      "name": "WIP Folder",
      "policy": {
        "member_policy": {
          ".tag": "anyone"
        },
        "resolved_member_policy": {
          ".tag": "anyone"
        },
        "acl_update_policy": {
          ".tag": "editors"
        },
        "shared_link_policy": {
          ".tag": "anyone"
        },
        "viewer_info_policy": {
          ".tag": "enabled"
        }
      },
      "preview_url": "https://www.dropbox.com/scl/fo/zcabfx72968vk68a3bc19/AABxxIGsJbwfVYUawTYfgdfv?dl=0",
      "shared_folder_id": "6598198444",
      "time_invited": "2019-11-06T23:09:57Z",
      "access_inheritance": {
        ".tag": "inherit"
      }
    }
1 Accepted solution

Accepted Solutions

Re: is_team_folder returns false for team folders

Dropboxer

@chrismcfarling There are a few ways you can get the team space ID. For instance, you can get it from the 'root_info' returned by /2/users/get_current_account:

 

curl -X POST https://api.dropboxapi.com/2/users/get_current_account \
    --header "Authorization: Bearer <redacted>"

# {
# <redacted>
#   "root_info": {
#     ".tag": "team",
#     "root_namespace_id": "1990815600",
#     "home_namespace_id": "1990696960",
#     "home_path": "/db test"
#   }
# }

 

 

Or, if you're using a Dropbox Business API app with the team member file access permission, you can get it from /2/team/team_folder/list[/continue] or /2/team/namespaces/list[/continue]:

 

curl -X POST https://api.dropboxapi.com/2/team/team_folder/list \
    --header "Authorization: Bearer <redacted>" \
    --header "Content-Type: application/json" \
    --data "{}"

# {
#   "team_folders": [
#     {
#       "team_folder_id": "1990815600",
#       "name": "<redacted>",
#       "status": {
#         ".tag": "active"
#       },
#       "is_team_shared_dropbox": true,
#       "sync_setting": {
#         ".tag": "default"
#       },
#       "content_sync_settings": []
#     }
#   ],
# <redacted>
# }
curl -X POST https://api.dropboxapi.com/2/team/namespaces/list \
    --header "Authorization: Bearer <redacted>" \
    --header "Content-Type: application/json" \
    --data "{}"

# {
#   "namespaces": [
#     {
#       "name": "<redacted>",
#       "namespace_id": "1990815600",
#       "namespace_type": {
#         ".tag": "team_folder"
#       }
#     },
# <redacted>
#   ],
# <redacted>
# }

I recommend reading the Namespace Guide as it goes over some of these topics.

 

 

 

 

Reply
Loading...
15 Replies

Re: is_team_folder returns false for team folders

Star Collaborator | Level 18

@chrismcfarling wrote:

... The top level team space is My Team. Within that is a folder name WIP Folder. The list_folders API command shows that WIP Folder is not a team folder as is_team_folder is set to false. ...

In fact every folder returns "is_team_folder": false, ...

{
      ...,
      "is_inside_team_folder": true,
      "is_team_folder": false,
      ...
    }

Hi @chrismcfarling,

Technically, your folder is folder inside a team folder (as you have described above and is denoted in JSON). Byself it's not a team folder ( it's not a root! ). winking face

Hope this helps.

Reply
Loading...
Highlighted

Re: is_team_folder returns false for team folders

Explorer | Level 4

According to DB documentation here

https://help.dropbox.com/teams-admins/team-member/team-folders

any folder created under the root that the team has access to should be a team folder.

 

db team.jpg

 

Reply
Loading...

Re: is_team_folder returns false for team folders

Star Collaborator | Level 18

Hi @chrismcfarling,

Yes, that's true, but you point to Dropbox application documentation, not the API one! Unfortunately Dropbox documents are ambiguous very often and there is space for improvements. You can take a closer look on the API point documentation you are using (as much as possible - yes not very clear description, but ... ) or here for example.

PS: As far as I can see what you try achieve, possible solution might be or-ing result of both flags above. winking face

Reply
Loading...

Re: is_team_folder returns false for team folders

Explorer | Level 4

Well, the API documentaion references the application documentation.

db team2.jpg

The team folder link points to https://help.dropbox.com/teams-admins/team-member/team-folders

This clearly implies that is_team_folder should return true for any folder that DropBox is calling a Team folder. The fact that it doesn't is a fail on the part of DB.

Reply
Loading...

Re: is_team_folder returns false for team folders

Dropboxer

@chrismcfarling Thanks for the feedback, and apologies for confusion! Здравко is correct, in terms of the Dropbox API, the folder you referenced is not itself a team folder, but rather just contained inside a team folder. Accordingly, by default it inherits the access properties of the parent team folder.

Reply
Loading...

Re: is_team_folder returns false for team folders

Explorer | Level 4

Well then your documentation is all wrong. From what you're saying there is only a single team folder at the top level. All documentaion states that any folder within the team space, which has the building icon, is a team folder.

And from what I can tell the list_folders API command doesn't return any information on the top level team folder. So in what scenario would is_team_folder even be true? 

Reply
Loading...

Re: is_team_folder returns false for team folders

Dropboxer

@chrismcfarling Thanks for following up. I'll send this along to the team to request they make the documentation clearer.

For reference, there are two different configurations that a Business team can use. The older non-team space configuration allowed users to mount multiple team folders under their member folders, where each team folder would come up in the API as a team folder.

For the newer team space configuration, only the team space itself is considered a team folder. 

Here's an example of a call I just made on a test team using the team space configuration showing the team space itself showing "is_team_folder": true:

curl -X POST https://api.dropboxapi.com/2/sharing/get_folder_metadata \
    --header "Authorization: Bearer <REDACTED>" \
    --header "Content-Type: application/json" \
    --data "{\"shared_folder_id\": \"1990815600\"}"

# {
#   "access_type": {
#     ".tag": "editor"
#   },
#   "is_inside_team_folder": false,
#   "is_team_folder": true,
#   "owner_team": {
#     "id": "<REDACTED>",
#     "name": "<REDACTED>"
#   },
#   "name": "<REDACTED>",
#   "policy": {
#     "member_policy": {
#       ".tag": "anyone"
#     },
#     "resolved_member_policy": {
#       ".tag": "anyone"
#     },
#     "acl_update_policy": {
#       ".tag": "editors"
#     },
#     "shared_link_policy": {
#       ".tag": "anyone"
#     },
#     "viewer_info_policy": {
#       ".tag": "enabled"
#     }
#   },
#   "preview_url": "<REDACTED>",
#   "shared_folder_id": "1990815600",
#   "time_invited": "2017-12-15T19:23:33Z",
#   "access_inheritance": {
#     ".tag": "inherit"
#   }
# }
Reply
Loading...

Re: is_team_folder returns false for team folders

Explorer | Level 4

How did you retrieve the shared_folder_id of the team folder to use with the get_folder_metadata command?

Reply
Loading...

Re: is_team_folder returns false for team folders

Star Collaborator | Level 18

grinning face Take a look on your initial post:

"shared_folder_id": "6598198444"

winking face 

Reply
Loading...
API Support

Have a question? Our Dropbox Community is here to help you find an answer!
You won’t have to wait too long for a reply, but why not learn more about the Community while you’re here.

Not the right discussion for you? Find out what else our Community has to say about API Support.

Or, search our Help Center for even more.