<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Error updating Preferred Name ( New First and Last name ) in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-updating-Preferred-Name-New-First-and-Last-name/m-p/779511#M34027</link>
    <description>&lt;P&gt;In your first attempt, I see you're putting other statements in place of the method's parameter names, which is not valid Python code, so you get that SyntaxError.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your second attempt, I see you're supplying a list of UserSelectorArg, that is `[user]`, instead of just a single UserSelectorArg as &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox_client.DropboxTeam.team_members_set_profile_v2" target="_blank" rel="noopener"&gt;documented&lt;/A&gt;, that is just `user`, so you get that ValidationError.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your third attempt, I see you are using the correct parameter names and types, but note that you don't need to call it three times. It looks like you're not setting anything on that first call, so that one seems unnecessary. Edit: unless that first line is just copied from the documentation, and not something you're actually running? &lt;/P&gt;</description>
    <pubDate>Wed, 26 Jun 2024 20:55:25 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2024-06-26T20:55:25Z</dc:date>
    <item>
      <title>Error updating Preferred Name ( New First and Last name )</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-updating-Preferred-Name-New-First-and-Last-name/m-p/779319#M34015</link>
      <description>&lt;P&gt;We got a requirement to update our Dropbox first and last name. Is it simply to to use info to update an existing user Dropbox first name and last name. Our wrote the code using json API but not as familiar with Python SDK. Any help is greatly appreciated&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I tried below but it doesnt update the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;user = dropbox.team.UserSelectorArg.email(dropboxemail)&lt;BR /&gt;result = dbx_team.team_members_get_info_v2([user])&lt;BR /&gt;print(result)&lt;/P&gt;
&lt;P&gt;for info in result.members_info:&lt;BR /&gt;if info.is_member_info():&lt;BR /&gt;print("\n\nName is : " + str(info.get_member_info().profile.name) )&lt;BR /&gt;print("\n\nFirst Name is : " + str(info.get_member_info().profile.name.given_name))&lt;BR /&gt;print("\n\nLast Name is : " + str(info.get_member_info().profile.name.surname))&lt;/P&gt;
&lt;P&gt;print("Account ID : " + info.get_member_info().profile.team_member_id)&lt;BR /&gt;print("Email is : " + info.get_member_info().profile.email)&lt;BR /&gt;print("\nPersistent ID is : " + info.get_member_info().profile.persistent_id)&lt;BR /&gt;print("External ID is : " + info.get_member_info().profile.external_id)&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2024 11:47:04 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-updating-Preferred-Name-New-First-and-Last-name/m-p/779319#M34015</guid>
      <dc:creator>JohnAdam_CUNY</dc:creator>
      <dc:date>2024-06-26T11:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: Error updating Preferred Name ( New First and Last name )</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-updating-Preferred-Name-New-First-and-Last-name/m-p/779329#M34016</link>
      <description>&lt;P&gt;In the code snippet you shared here, I see you're calling &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox_client.DropboxTeam.team_members_get_info_v2" target="_blank"&gt;team_members_get_info_v2&lt;/A&gt;, which is a way to read the information for some team member(s). That doesn't change their information on Dropbox. If you want to change their member information (like first/last name) you should use &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox_client.DropboxTeam.team_members_set_profile_v2" target="_blank"&gt;team_members_set_profile_v2&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In any case, if something isn't working as expected, please share both the code and the unexpected error or output. (I see you mentioned getting an error in the title for this thread, but it doesn't look like you included that error output here.)&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2024 19:15:38 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-updating-Preferred-Name-New-First-and-Last-name/m-p/779329#M34016</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2024-06-25T19:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: Error updating Preferred Name ( New First and Last name )</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-updating-Preferred-Name-New-First-and-Last-name/m-p/779435#M34019</link>
      <description>&lt;P&gt;I checked the documentation but looking for clarification since we still use the old json API for 95% of our teams we are learning the new Python SDK for 1 team.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Instead of user do I pass the below. Can you provide an example of updating fname and lname for below?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;## New Code&lt;BR /&gt;user = dropbox.team.UserSelectorArg.email(dropboxemail)&lt;BR /&gt;result = dbx_team.team_members_set_profile_v2([user])&lt;BR /&gt;print(result)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;##OlD Get Info Code&lt;BR /&gt;for info in result.members_info:&lt;BR /&gt;if info.is_member_info():&lt;/P&gt;&lt;P&gt;if len(new_email) != 0:&lt;BR /&gt;info.get_member_info().profile.email = new_email&lt;BR /&gt;if len(fname) != 0:&lt;BR /&gt;info.get_member_info().profile.name.given_name = fname&lt;BR /&gt;if len(lname) != 0:&lt;BR /&gt;nfo.get_member_info().profile.name.surname = lname&lt;BR /&gt;if len(emplid) != 0:&lt;BR /&gt;info.get_member_info().profile.persistent_id = emplid&lt;BR /&gt;if len(newExID) != 0:&lt;BR /&gt;info.get_member_info().profile.external_id = newExID&lt;BR /&gt;#######################################################################################&lt;BR /&gt;print("\n\nName is : " + str(info.get_member_info().profile.name) )&lt;BR /&gt;print("\nFirst name is : " + str(info.get_member_info().profile.name.given_name))&lt;BR /&gt;print("Last Name is : " + str(info.get_member_info().profile.name.surname))&lt;BR /&gt;print("Account ID : " + info.get_member_info().profile.team_member_id)&lt;BR /&gt;print("Email is : " + info.get_member_info().profile.email)&lt;BR /&gt;print("\nPersistent ID is : " + info.get_member_info().profile.persistent_id)&lt;BR /&gt;print("External ID is : " + info.get_member_info().profile.external_id)&lt;BR /&gt;elif info.is_id_not_found():&lt;BR /&gt;print("User not found.")&lt;BR /&gt;else:&lt;BR /&gt;print("Other scenario not anticipated. Need to traige...")&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2024 11:54:56 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-updating-Preferred-Name-New-First-and-Last-name/m-p/779435#M34019</guid>
      <dc:creator>JohnAdam_CUNY</dc:creator>
      <dc:date>2024-06-26T11:54:56Z</dc:date>
    </item>
    <item>
      <title>Re: Error updating Preferred Name ( New First and Last name )</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-updating-Preferred-Name-New-First-and-Last-name/m-p/779459#M34024</link>
      <description>&lt;P&gt;&lt;a href="https://www.dropboxforum.com/t5/user/viewprofilepage/user-id/1521086"&gt;@JohnAdam_CUNY&lt;/a&gt; I don't believe we have sample code handy for team_members_set_profile_v2 in particular, so please refer to &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox_client.DropboxTeam.team_members_set_profile_v2" target="_blank"&gt;the documentation&lt;/A&gt; for information on the parameters to use with that method. For example, it sounds like you'd need to use the "user", "new_given_name", and "new_surname" for your use case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try that out and if it doesn't work for you, please share the relevant code and output so we can help troubleshoot.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2024 15:06:57 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-updating-Preferred-Name-New-First-and-Last-name/m-p/779459#M34024</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2024-06-26T15:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: Error updating Preferred Name ( New First and Last name )</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-updating-Preferred-Name-New-First-and-Last-name/m-p/779464#M34025</link>
      <description>&lt;P&gt;See below issue it appears not to accept my variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Test #1&lt;/P&gt;&lt;P&gt;dbx_team = dropbox.DropboxTeam(&lt;BR /&gt;oauth2_refresh_token=REFRESH_TOKEN,&lt;BR /&gt;app_key=APP_KEY,&lt;BR /&gt;app_secret=APP_SECRET)&lt;BR /&gt;user = dropbox.team.UserSelectorArg.email(dropboxemail&lt;/P&gt;&lt;P&gt;if len(new_email) != 0:&lt;BR /&gt;result = dbx_team.team_members_set_profile_v2([user],new_email=new_email)&lt;BR /&gt;print(result)&lt;BR /&gt;if len(fname) != 0:&lt;BR /&gt;result = dbx_team.team_members_set_profile_v2([user],info.get_member_info().profile.name.given_name = fname)&lt;BR /&gt;print(result)&lt;BR /&gt;if len(lname) != 0:&lt;BR /&gt;result = dbx_team.team_members_set_profile_v2([user], info.get_member_info().profile.name.new_surname=lname)&lt;BR /&gt;print(result)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Error:&lt;BR /&gt;C:\Users\jdebh\Anaconda3\python.exe "S:\Academic Collaboration Technology\DROP BOX\DropboxPROD\CORECODE\OAUTH_COSEN_SET_INFO.py"&lt;BR /&gt;File "S:\Academic Collaboration Technology\DROP BOX\DropboxPROD\CORECODE\OAUTH_COSEN_SET_INFO.py", line 30&lt;BR /&gt;result = dbx_team.team_members_set_profile_v2([user],info.get_member_info().profile.name.given_name = fname)&lt;BR /&gt;^&lt;BR /&gt;SyntaxError: expression cannot contain assignment, perhaps you meant "=="?&lt;/P&gt;&lt;P&gt;Process finished with exit code 1&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Test #2&lt;/P&gt;&lt;P&gt;dbx_team = dropbox.DropboxTeam(&lt;BR /&gt;oauth2_refresh_token=REFRESH_TOKEN,&lt;BR /&gt;app_key=APP_KEY,&lt;BR /&gt;app_secret=APP_SECRET)&lt;BR /&gt;user = dropbox.team.UserSelectorArg.email(dropboxemail)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if len(new_email) != 0:&lt;BR /&gt;result = dbx_team.team_members_set_profile_v2([user],new_email=new_email)&lt;BR /&gt;print(result)&lt;BR /&gt;if len(fname) != 0:&lt;BR /&gt;result = dbx_team.team_members_set_profile_v2([user], new_given_name=str(fname))&lt;BR /&gt;print(result)&lt;BR /&gt;if len(lname) != 0:&lt;BR /&gt;result = dbx_team.team_members_set_profile_v2([user], new_surname=str(lname))&lt;BR /&gt;print(result)&lt;BR /&gt;&lt;BR /&gt;Error:&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "S:\Academic Collaboration Technology\DROP BOX\DropboxPROD\CORECODE\OAUTH_COSEN_SET_INFO.py", line 32, in &amp;lt;module&amp;gt;&lt;BR /&gt;result = dbx_team.team_members_set_profile_v2([user], new_given_name=str(fname))&lt;BR /&gt;File "C:\Users\jdebh\Anaconda3\lib\site-packages\dropbox\base_team.py", line 2065, in team_members_set_profile_v2&lt;BR /&gt;arg = team.MembersSetProfileArg(user,&lt;BR /&gt;File "C:\Users\jdebh\Anaconda3\lib\site-packages\dropbox\team.py", line 9112, in __init__&lt;BR /&gt;self.user = user&lt;BR /&gt;File "C:\Users\jdebh\Anaconda3\lib\site-packages\stone\backends\python_rsrc\stone_base.py", line 79, in __set__&lt;BR /&gt;self.validator.validate_type_only(value)&lt;BR /&gt;File "C:\Users\jdebh\Anaconda3\lib\site-packages\stone\backends\python_rsrc\stone_validators.py", line 612, in validate_type_only&lt;BR /&gt;raise ValidationError('expected type %s or subtype, got %s' %&lt;BR /&gt;stone.backends.python_rsrc.stone_validators.ValidationError: expected type dropbox.team.UserSelectorArg or subtype, got list&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2024 15:54:24 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-updating-Preferred-Name-New-First-and-Last-name/m-p/779464#M34025</guid>
      <dc:creator>JohnAdam_CUNY</dc:creator>
      <dc:date>2024-06-26T15:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: Error updating Preferred Name ( New First and Last name )</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-updating-Preferred-Name-New-First-and-Last-name/m-p/779470#M34026</link>
      <description>&lt;P&gt;Documentation is not clear. See solution. Please advise if I misunderstood anything.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;team_members_set_profile_v2(user, new_email=None, new_external_id=None, new_given_name=None, new_surname=None, new_persistent_id=None, new_is_directory_restricted=None)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if len(fname) != 0:&lt;BR /&gt;result = dbx_team.team_members_set_profile_v2(user=user, new_given_name=fname)&lt;BR /&gt;print(result)&lt;BR /&gt;if len(lname) != 0:&lt;BR /&gt;result = dbx_team.team_members_set_profile_v2(user=user, new_surname=lname)&lt;BR /&gt;print(result)&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2024 16:21:13 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-updating-Preferred-Name-New-First-and-Last-name/m-p/779470#M34026</guid>
      <dc:creator>JohnAdam_CUNY</dc:creator>
      <dc:date>2024-06-26T16:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: Error updating Preferred Name ( New First and Last name )</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-updating-Preferred-Name-New-First-and-Last-name/m-p/779511#M34027</link>
      <description>&lt;P&gt;In your first attempt, I see you're putting other statements in place of the method's parameter names, which is not valid Python code, so you get that SyntaxError.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your second attempt, I see you're supplying a list of UserSelectorArg, that is `[user]`, instead of just a single UserSelectorArg as &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/api/dropbox.html#dropbox.dropbox_client.DropboxTeam.team_members_set_profile_v2" target="_blank" rel="noopener"&gt;documented&lt;/A&gt;, that is just `user`, so you get that ValidationError.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your third attempt, I see you are using the correct parameter names and types, but note that you don't need to call it three times. It looks like you're not setting anything on that first call, so that one seems unnecessary. Edit: unless that first line is just copied from the documentation, and not something you're actually running? &lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2024 20:55:25 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-updating-Preferred-Name-New-First-and-Last-name/m-p/779511#M34027</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2024-06-26T20:55:25Z</dc:date>
    </item>
  </channel>
</rss>

