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

Forum Discussion

Isle10oz's avatar
Isle10oz
Explorer | Level 4
7 months ago

How to determine the folder type?

Hi. (I am using translation tool.)

I think the following method can be used to determine the folder type (team member folder, team folder, shared folder), is this correct?
I think it can be determined in the following order:
----------
Step.1: Use "files/get_metadata" endpoint to get the metadata to determine the folder type.
 
If the "shared_folder_id" in the metadata that obtained by Step.1 is null. and
If the "parent_shared_folder_id" in the metadata that obtained by Step.1 is null, or the same as the root namespace ID.
→ Step.2: Determine that the folder type is "team member folder".
 
If the "shared_folder_id" in the metadata that obtained by Step.1 is null. and
If the "parent_shared_folder_id" in the metadata that obtained by Step.1 has a value that is not the root namespace ID.
→ Step.2: Call the "sharing/get_folder_metadata" endpoint with that information as an argument.
→ Step.3: Determine whether it is a team folder or a shared folder using "is_team_folder" in the result of Step.2.
 
If the "shared_folder_id" in the metadata that obtained by Step.1 has a value. (is not null)
→ Step.2: Call the "sharing/get_folder_metadata" endpoint with that information as an argument.
→ Step.3: Determine whether it is a team folder or a shared folder using "is_team_folder" in the result of Step.2.

----------
Thask!

 

2 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    7 months ago

    For reference, please refer to the documentation for specific information on what each field means. We cannot make guarantees beyond what is in the documentation.

    To confirm, both shared folders and team folders are considered a type of "shared folder. For the metadata returned by /2/files/get_metadata (as well as /2/files/list_folder[/continue]), sharing_info.shared_folder_id will be set if a folder is a shared folder, and if so will contain the shared folder ID; sharing_info.parent_shared_folder_id will be set if the item is contained in a shared folder and if so will contain the parent folder's shared folder ID.

    And yes, for any given shared folder, you can use is_team_folder returned by /2/sharing/get_folder_metadata to determine if it is a team folder or not.

    The API doesn't return a specific identifier like that for identifying member folders in the folder metadata in particular, but I'll pass this along as a feature request. I can't promise if or when that might be implemented though.

  • Isle10oz's avatar
    Isle10oz
    Explorer | Level 4
    7 months ago

    Thank you for your response!
    I have shared it with my team.

    If there is anything additional I need to check, I will add it.

About Discuss Dropbox Developer & API

Node avatar for Discuss Dropbox Developer & API
Make connections with 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!