We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

maverick1985's avatar
maverick1985
Explorer | Level 3
2 months ago

How to determine admin user to be used in select_admin for team folders?

I am using below api to get the list of all users. How to determine the admin from these users
I need to use his/her id for select_admin: in subsequent calls for listing team folders

const headers = {
Authorization: `Bearer ${accessToken}`,
'Content-Type': 'application/json',
};
  • DB-Des's avatar
    DB-Des
    Icon for Dropbox Engineer rankDropbox Engineer

    Hi maverick1985,

     

    In the response object from the request sent to /team/members/list_v2[continue] endpoint, you should check if the roles property is present. The information contained in this property provides the role_id, the type of admin role the user has (under name), and a short description of the role.

     

    As such:

     

    "roles": [
            {
              "role_id": "pid_dbtmr:AAAAAFMcx6E0tax39",
              "name": "Team",
              "description": "Manage everything and access all permissions"
            }
    ]

     

     

    Additionally, a request to /team/members/get_available_team_member_roles provides the available team roles for the connected team, along with each role's respective role_id — for roles defined by Dropbox, this ID is the same across all teams.

     

    This information could then be used to filter through the list of returned users.

     

    I hope you find this information helpful!