Select to view content in your preferred language

API Add User with POST URL

495
2
08-22-2023 05:28 AM
Amagaad
New Contributor

Hello

Our users sign in via enterprise.

I am trying to make use of the post api to add a user

https://(site)/portal/sharing/rest/community/users/(username)/add

I have tried various formats for the (username). joeblogs@domain, domain\joebloggs.

However every time I get the response 'User does not exist or is inaccessible'.

If I call the api to get the userinfo with joebloggs@domain it works fine e.g.

https://(site)/portal/sharing/rest/community/users/jobloggs@domain

Can anyone help advise? Is the post api add url incorrect?

Many thanks

0 Kudos
2 Replies
JakeSkinner
Esri Esteemed Contributor

Hi @Amagaad ,

Are you trying to create a user in Enterprise?  If so, use the createUser command instead.

0 Kudos
NicolasGIS
Frequent Contributor

Hi @Amagaad,

I guess you found the solution in the meantime but I am sharing my experience for others facing the same issue. I faced it running a migration script of my users from SAML provider to OIDC one. Script was coded using Python API for ArcGIS and adding a 5-second sleep between processing each user solved this issue. 

time.sleep(5)

I guess as the error message is a bit misleading !

0 Kudos