cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you using the Microsoft co-authoring beta for Dropbox? Share your feedback and learn more about it 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: 

Python SDK dbx_team.team_members_get_info_v2 need to list EMPLID, PERSISTENT ID, EXTERNAL ID,, etc.

Python SDK dbx_team.team_members_get_info_v2 need to list EMPLID, PERSISTENT ID, EXTERNAL ID,, etc.

JohnAdam_CUNY
Helpful | Level 6
Go to solution

Python SDK for Dropbox:

 

I am able to get the team member id but I also need to list given name, surname, external id, persistent id, and email.

 

See below code sample.

 

For results I get class List and result(0] gives me the below as well.
for info I get MembersGetInfoItemV2('member_info', TeamMemberInfoV2(profile=TeamMemberProfile(account_id=DATA REMOVED...

 

 

------ Code Snippet -------
user = dropbox.team.UserSelectorArg.email(email)
result = dbx_team.team_members_get_info_v2([user])
print(result._members_info_value)
for info in result.members_info:
if info.is_member_info():
DBMID_NEW_USER= info.get_member_info().profile.team_member_id
print(info)

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

The following all work for me:

print(info.get_member_info().profile.name)
print(info.get_member_info().profile.name.given_name)
print(info.get_member_info().profile.name.surname)
print(info.get_member_info().profile.name.display_name)

Note though that the values won't be set if the account doesn't have a name set yet (e.g., if it's a new invite).

 

If something isn't working correctly for you, feel free to share the code you're running and the full error/output you get.

View solution in original post

4 Replies 4

Greg-DB
Dropbox Staff
Go to solution

The 'profile' seen in this code/output is a TeamMemberProfile, which is based on MemberProfile, so you can access whatever of those documented fields you need there, just like you currently for do for 'team_member_id'.

 

So, for example, just like you access ...'.profile.team_member_id', you can access ...'.profile.external_id ', etc.

JohnAdam_CUNY
Helpful | Level 6
Go to solution

Thanks that worked it gotr stuck on Name. DOesnt appear to be an attribute under profile. is there another way to get the Display name

Greg-DB
Dropbox Staff
Go to solution

The following all work for me:

print(info.get_member_info().profile.name)
print(info.get_member_info().profile.name.given_name)
print(info.get_member_info().profile.name.surname)
print(info.get_member_info().profile.name.display_name)

Note though that the values won't be set if the account doesn't have a name set yet (e.g., if it's a new invite).

 

If something isn't working correctly for you, feel free to share the code you're running and the full error/output you get.

JohnAdam_CUNY
Helpful | Level 6
Go to solution

Yeah it was weird I had to do the below to get a the name.  The error I got was a bit confusing but maybe it was my compiler. print(" Name is :" + str(info.get_member_info().profile.name) )

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    JohnAdam_CUNY Helpful | Level 6
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?