<?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: Create User for AGO 'Unable to Create &amp;lt;username&amp;gt;' error. in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/create-user-for-ago-unable-to-create-lt-username/m-p/1064470#M6166</link>
    <description>&lt;P&gt;Looking at the &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.UserManager.create" target="_self"&gt;API docs&lt;/A&gt;, it would appear that the &lt;STRONG&gt;user_type&lt;/STRONG&gt; is a required string. Try your same code but with &lt;FONT face="simsun,hei"&gt;"user_type='Viewer'"&lt;/FONT&gt;added to the parameters.&lt;/P&gt;</description>
    <pubDate>Thu, 03 Jun 2021 02:47:48 GMT</pubDate>
    <dc:creator>jcarlson</dc:creator>
    <dc:date>2021-06-03T02:47:48Z</dc:date>
    <item>
      <title>Create User for AGO 'Unable to Create &lt;username&gt;' error.</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/create-user-for-ago-unable-to-create-lt-username/m-p/1057885#M6062</link>
      <description>&lt;P&gt;I am using the Python package to create a script that should create AGO users.&lt;/P&gt;&lt;P&gt;When testing the package, I create the GIS object using my account details (I have admin role) and then create the new user, but an "Unable to create &amp;lt;username&amp;gt;" error is thrown.&lt;/P&gt;&lt;P&gt;When investigating the issue, it seems when the package sends the post request, the username is returned in the "notInvited" list and thus the user creation fails. I tried using a real email but it still fails.&lt;/P&gt;&lt;P&gt;I have searched the web for a while now and have found no solutions to this problem.&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# school is replaced by my school name, xxx and yyy are my username and password
gis = GIS(url='https://school.maps.arcgis.com', username='xxx', password='yyy')

    newuser = gis.users.create(
        username='pythontest',
        password='10@1232.adbsd.ADSF',
        firstname='python',
        lastname='test',
        email='pythonTest@gmail.com',
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 13 May 2021 22:20:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/create-user-for-ago-unable-to-create-lt-username/m-p/1057885#M6062</guid>
      <dc:creator>JPGarCar</dc:creator>
      <dc:date>2021-05-13T22:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: Create User for AGO 'Unable to Create &lt;username&gt;' error.</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/create-user-for-ago-unable-to-create-lt-username/m-p/1064470#M6166</link>
      <description>&lt;P&gt;Looking at the &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.UserManager.create" target="_self"&gt;API docs&lt;/A&gt;, it would appear that the &lt;STRONG&gt;user_type&lt;/STRONG&gt; is a required string. Try your same code but with &lt;FONT face="simsun,hei"&gt;"user_type='Viewer'"&lt;/FONT&gt;added to the parameters.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jun 2021 02:47:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/create-user-for-ago-unable-to-create-lt-username/m-p/1064470#M6166</guid>
      <dc:creator>jcarlson</dc:creator>
      <dc:date>2021-06-03T02:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: Create User for AGO 'Unable to Create &lt;username&gt;' error.</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/create-user-for-ago-unable-to-create-lt-username/m-p/1105478#M6718</link>
      <description>&lt;P&gt;I was facing the same issue mentioned above and was able to resolve it by adding the user_type and the role syntax. Now how to know which user_type and role to add, refer to the following documentation (&lt;A href="https://developers.arcgis.com/rest/enterprise-administration/portal/create-user.htm" target="_blank" rel="noopener"&gt;Create User—ArcGIS REST APIs | ArcGIS Developers&lt;/A&gt;). Check sections "&lt;SPAN&gt;role&lt;/SPAN&gt;" and "&lt;SPAN&gt;userLicenseTypeId&lt;/SPAN&gt;".&lt;/P&gt;&lt;P&gt;Example = I am creating a new user with role (Viewer) and user type (Viewer). As per the above cited documentation I will use role as "&lt;SPAN&gt;iAAAAAAAAAAAAAAA&lt;/SPAN&gt;" and user_type as "&lt;SPAN class=""&gt;viewerUT&lt;/SPAN&gt;". Hope this helps.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2021 10:44:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/create-user-for-ago-unable-to-create-lt-username/m-p/1105478#M6718</guid>
      <dc:creator>Shaw007</dc:creator>
      <dc:date>2021-10-07T10:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: Create User for AGO 'Unable to Create &lt;username&gt;' error.</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/create-user-for-ago-unable-to-create-lt-username/m-p/1359223#M9399</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/484108"&gt;@JPGarCar&lt;/a&gt;&amp;nbsp;This is old old old but....how does one review the requests the .create() call is making? I'm having a similar problem, which is how I found myself to this post. The difference is that I had my code working fine a few days ago and could create users. Now they fail. I'd like to figure out the next phase in troubleshooting and reviewing the requests would help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2023 17:32:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/create-user-for-ago-unable-to-create-lt-username/m-p/1359223#M9399</guid>
      <dc:creator>SFM_TravisBott</dc:creator>
      <dc:date>2023-12-11T17:32:17Z</dc:date>
    </item>
  </channel>
</rss>

