<?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: Unable to create a new user via ArcGIS API in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/unable-to-create-a-new-user-via-arcgis-api/m-p/811809#M2485</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Duncan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I still get the same error with your code, running from both jupyter notebook and python window in pro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Feb 2020 16:16:47 GMT</pubDate>
    <dc:creator>AdrianHughes3</dc:creator>
    <dc:date>2020-02-24T16:16:47Z</dc:date>
    <item>
      <title>Unable to create a new user via ArcGIS API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/unable-to-create-a-new-user-via-arcgis-api/m-p/811806#M2482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am exploring&amp;nbsp;some scripting of the ArcGIS API for Python in the hope I can automate some future scenario. I&amp;nbsp;have an administrator role on ArcGIS Online.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All I am trying to do is create a user that is a viewer as we have some unused viewer licenses to test with. My code is simply this, where xxx,yyy are my username and password.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcgis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;gis &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; GIS
&lt;SPAN class="comment token"&gt;# User name is case sensative as is password!&lt;/SPAN&gt;
gis &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; GIS&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"https://geodatainstitute.maps.arcgis.com"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"xxx"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"yyy"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# https://www.arcgis.com&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;gis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;users&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;counts&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'user_type'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# This line runs OK&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"create a new user"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
newuser &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; gis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;users&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;create&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;username&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'testuserxxx'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; password&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'q1w2e3r4t5y6,.&amp;lt;&amp;gt;'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; firstname &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Firstxxx'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; lastname &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'Secondsxxx'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; email &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'test@test.com'&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; role&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'org_user'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; level&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; provider &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'arcgis'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; newuser &lt;SPAN class="keyword token"&gt;is&lt;/SPAN&gt; None&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"FAILED!"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It always returns this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;create a new user&lt;BR /&gt;Unable to create testuserxxx&lt;BR /&gt;Unable to create testuserxxx&lt;BR /&gt;FAILED!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What am I doing wrong? I have followed the example as shown &lt;A href="https://developers.arcgis.com/python/guide/accessing-and-managing-users/#creating-new-user-accounts" rel="nofollow noopener noreferrer" target="_blank"&gt;here&lt;/A&gt;. I have also tried connecting to&amp;nbsp;&lt;EM&gt;&lt;A href="https://www.arcgis.com&amp;nbsp;" target="_blank"&gt;https://www.arcgis.com&amp;nbsp;&lt;/A&gt;&lt;/EM&gt; but I still get the same error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there some setting on AGOL that needs turning on/off, have I set up the role/level correctly? If one looks at the &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#usermanager" rel="nofollow noopener noreferrer" target="_blank"&gt;UserManager&lt;/A&gt; class on the API help file it confusing indicates that&amp;nbsp;&lt;SPAN style="color: #404040; background-color: #f3f6f6;"&gt;user_type &lt;/SPAN&gt;is a required parameter but that seems not the case?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help or advice would be much appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Duncan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:32:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/unable-to-create-a-new-user-via-arcgis-api/m-p/811806#M2482</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2021-12-12T09:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to create a new user via ArcGIS API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/unable-to-create-a-new-user-via-arcgis-api/m-p/811807#M2483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm also having this issue, even when trying the example code,&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;shown &lt;A href="https://developers.arcgis.com/python/guide/accessing-and-managing-users/#creating-new-user-accounts"&gt;here&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Feb 2020 14:56:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/unable-to-create-a-new-user-via-arcgis-api/m-p/811807#M2483</guid>
      <dc:creator>AdrianHughes3</dc:creator>
      <dc:date>2020-02-21T14:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to create a new user via ArcGIS API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/unable-to-create-a-new-user-via-arcgis-api/m-p/811808#M2484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Adrian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been playing around with my very simple code above as no one offered up any pearls of wisdom... You would think ESRI staff would be all over this. Anyway this finally worked...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;newuser &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; gis&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;users&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;create&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"testuserxyz"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"1234567890QWERTYuio"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Dumbo"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Dumbo2"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"test@test.com"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;None&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;None&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"arcgis"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;None&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;None&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"viewer"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue seemed to be with the password length and characters. Try something like above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only other difference was that I was running the code from within the Python command line window in Pro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2020 15:52:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/unable-to-create-a-new-user-via-arcgis-api/m-p/811808#M2484</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2020-02-24T15:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to create a new user via ArcGIS API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/unable-to-create-a-new-user-via-arcgis-api/m-p/811809#M2485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Duncan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I still get the same error with your code, running from both jupyter notebook and python window in pro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2020 16:16:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/unable-to-create-a-new-user-via-arcgis-api/m-p/811809#M2485</guid>
      <dc:creator>AdrianHughes3</dc:creator>
      <dc:date>2020-02-24T16:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to create a new user via ArcGIS API</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/unable-to-create-a-new-user-via-arcgis-api/m-p/1548248#M10763</link>
      <description>&lt;P&gt;For friends who come across this later and grit your teeth on why this won't work, I found that my organization only allowed the user type "Creator" with a custom role. When the user type and role were modified to be exactly what the org required, it worked like a charm.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AFackler_NAPSG_0-1728699290695.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/117143i95653B7203A9D83B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AFackler_NAPSG_0-1728699290695.png" alt="AFackler_NAPSG_0-1728699290695.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2024 02:15:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/unable-to-create-a-new-user-via-arcgis-api/m-p/1548248#M10763</guid>
      <dc:creator>AFackler_NAPSG</dc:creator>
      <dc:date>2024-10-12T02:15:05Z</dc:date>
    </item>
  </channel>
</rss>

