<?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: Different errors when passing string to invite_users in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/different-errors-when-passing-string-to-invite/m-p/1093414#M6557</link>
    <description>&lt;P&gt;This now works, at least with API version 1.8.1. I passed in a list of another organisation's users and got the 'True' response. Have confirmed they are receiving the invites.&lt;/P&gt;</description>
    <pubDate>Sun, 29 Aug 2021 22:02:38 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-08-29T22:02:38Z</dc:date>
    <item>
      <title>Different errors when passing string to invite_users</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/different-errors-when-passing-string-to-invite/m-p/870968#M4650</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;invite_users should actually take a list, of course. But if I pass a string by mistake/by not reading the docs closely enough, I encounter two different responses, neither of which indicates that the format was the issue, and one of which suggests there is any issue at all.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I pass a nonsense string ("boo"), the value returned is simply True-- aka the same response as when I pass a list of valid usernames. Obviously with "boo" I wouldn't expect an actual user to have been invited, but I also get this response with invalid usernames, including for example a colleague's username with one letter missing. This non-error also occurs when I pass nonsense or invalid usernames via a list, which would make troubleshooting typos almost impossible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I pass a valid username as a string, though, I get the error "Unable to invite Public Account to a group owned by an organization." These users are not public accounts, they are organizational accounts owned by&amp;nbsp;the same org that owns the group (OR are organizational accounts owned by a different org-- in both cases, it seems to recognize that the username is valid, even when external users' accounts are not publicly visible).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But&amp;nbsp;a&amp;nbsp;string is the wrong format, period. Why first of all is this not recognized or flagged in some way (an integer throws a TypeError)? Second, what is going on such that something evidently distinguishes between a string which is a valid username (in-org or not) and a string which is not even if it conforms to the same format as a proper organizational username (bsmith_umafm vs bmith_umafm, say)?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Aug 2019 12:30:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/different-errors-when-passing-string-to-invite/m-p/870968#M4650</guid>
      <dc:creator>MTaft-Ferguson</dc:creator>
      <dc:date>2019-08-01T12:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: Different errors when passing string to invite_users</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/different-errors-when-passing-string-to-invite/m-p/870969#M4651</link>
      <description>&lt;P&gt;I hit the exact same problem with passing a list of users, the response is always True even though it hasn't added those users. I then passed in users from another organisation that I needed to invite to a group in our&amp;nbsp;organisation, and I get the error below despite them &lt;STRONG&gt;not&lt;/STRONG&gt; being Public Accounts.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;my_gis = gis.GIS(my_gis_url,username, password,verify_cert=False)&lt;BR /&gt;print("Logged into ArcGIS Online")&lt;BR /&gt;groupID = 'cbbbxyz'&lt;BR /&gt;my_group = my_gis.groups.get(groupID)&lt;/P&gt;&lt;P&gt;usernames = ['xyz_ETC','xyy_ETC']&lt;BR /&gt;new_users = my_group.invite_users(usernames, role='group_member', expiration=10080)&lt;BR /&gt;print(new_users)&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;P&gt;Unable to invite Public Account to a group owned by an organization.&lt;BR /&gt;Traceback (most recent call last):&lt;BR /&gt;File "C:\Users\myusername\Python\InviteUsersToGroup.py", line 66, in &amp;lt;module&amp;gt;&lt;BR /&gt;new_users = my_group.invite_users(usernames, role='group_member', expiration=10080)&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py", line 4107, in invite_users&lt;BR /&gt;return self._portal.invite_group_users(usernames, self.groupid, role, expiration)&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\portalpy.py", line 1281, in invite_group_users&lt;BR /&gt;postdata)&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\connection.py", line 1159, in post&lt;BR /&gt;self._handle_json_error(resp_json['error'], errorcode)&lt;BR /&gt;File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\connection.py", line 1180, in _handle_json_error&lt;BR /&gt;raise RuntimeError(errormessage)&lt;BR /&gt;RuntimeError: Unable to invite Public Account to a group owned by an organization.&lt;BR /&gt;(Error Code: 400)&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/45514" target="_blank" rel="noopener"&gt;Atma Mani&lt;/A&gt;&amp;nbsp;is it possible to use invite_users for inviting other Organisations' users to a group?&lt;/P&gt;</description>
      <pubDate>Sun, 29 Aug 2021 20:46:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/different-errors-when-passing-string-to-invite/m-p/870969#M4651</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-08-29T20:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: Different errors when passing string to invite_users</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/different-errors-when-passing-string-to-invite/m-p/1093414#M6557</link>
      <description>&lt;P&gt;This now works, at least with API version 1.8.1. I passed in a list of another organisation's users and got the 'True' response. Have confirmed they are receiving the invites.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Aug 2021 22:02:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/different-errors-when-passing-string-to-invite/m-p/1093414#M6557</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-08-29T22:02:38Z</dc:date>
    </item>
  </channel>
</rss>

