i am trying to automate the creation of named users on arcgis online. I am basically using the code from the example notebooks. And it always fails
the gis object is created with an administrator connection, and i tested it with version 1.7.0 as well, same error. So, my question would be, is there any way to get a more detailed response from the api, like the actual response of the rest call or something? Or in general, what am i doing wrong here?
Thanks for your input.
Hey William, thanks for taking the time to look at my problems
The gis object is created as follows:
I tried the gis.user, but i am pretty sure, that users is correct, because the API Reference lists the create() method as a method of the user-manager class (users) and not the user class. See arcgis.gis module
So from my point of view, the method/syntax is correct, but it does not work....
Yes, your syntax does appear to be correct. Can you remove all of the parameters in your create command that follow the role='org_user' portion? You might try trimming that section down a bit to get to the bare minimum parameters required for creating a user. It's possible that some of those parameters don't apply to AGOL; only to Portal.
It looks like the API reference is actually wrong here. It states the username needs to be unique in Portal, but in my experience for AGOL it needs to be unique not only for the active AGOL environment but for all environments.
I ran into the same issue in an AGOL environment with only a single user. With the above procedure I couldn't create a user with the username "username" (arbitrary, 6-24 characters). Changing the username to "username_SOMETHING" made it work for me.
This is reproducible creating a user by administrating AGOL through a browser and browsing to organization/users - creating a username that exists outside the active AGOL environment is impossible (username already exists).