cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: Get dbmid

Get dbmid

JohnAdam_CUNY
Helpful | Level 6
Go to solution

I'm working on code that copies two files from our team admin. I was able to write all the copy reference code but now it wants me to have the member_Id but the only information I have is their email.

 

1 Accepted Solution

Accepted Solutions

JohnAdam_CUNY
Helpful | Level 6
Go to solution

OK but I got a weird result type <class 'dropbox.team.MembersGetInfoV2Result'> I just want the dbmid or account_id.  Is this a list?

View solution in original post

3 Replies 3

Greg-DB
Dropbox Staff
Go to solution

You can get the team member ID (from the team_member_id field) for any particular member from a number of different ways using the API, generally anywhere that the API returns team member information.

 

For example, you can get the information about any particular team member, for instance by supplying their email address, by calling /2/team/members/get_info_v2. That's team_members_get_info_v2 in the Python SDK.

 

Or you can list all team members using /2/team/members/list_v2[/continue]. That's team_members_list_v2 and team_members_list_continue_v2 in the Python SDK.

 

Or you can get the new team member information when adding a new team member by calling /2/team/members/add_v2. That's team_members_add_v2 in the Python SDK.

 

Check out the documentation linked above to see the return types for information on how to access the 'team_member_id' field. (It may be in a nested field, so be sure to click through the types as needed.)

JohnAdam_CUNY
Helpful | Level 6
Go to solution

OK but I got a weird result type <class 'dropbox.team.MembersGetInfoV2Result'> I just want the dbmid or account_id.  Is this a list?

Greg-DB
Dropbox Staff
Go to solution

No, MembersGetInfoV2Result is not itself a list, but its members_info field is a list containing the respective result for each user selector you specified in the call.

 

For example:

MEMBER_EMAIL = "something@example.com"

user_selector = dropbox.team.UserSelectorArg.email(MEMBER_EMAIL)
users_to_query = [user_selector]  # this can contain more than one

result = dbx_team.team_members_get_info_v2(members=users_to_query)

for info in result.members_info:
	if info.is_member_info():
		print(info.get_member_info().profile.team_member_id)
	elif info.is_id_not_found():
		print("User not found.")
	else:
		print("Other scenario.")

 

Need more support?