How can I change the User License Type using the REST API? I searched unsuccessful for an endpoint, I suspect there should be something similar like these endpoints:
Thank you @JohnPlunkett but I was looking for this:
and it looks like it exists but it is undocumented.
Here my findings in case someone else has a similar use case:
Hi Marc,
thanks for the speedy reply - much appreciated. I'll give it a try, but I'm actually starting to think I may need to update the portal, from 10.7.x I can't see the /updateUserLicenseType method on the /arcgis/sharing/rest/portals/self endpoint. Can you please confirm this, if running a newer version of Portal?
thanks again
Gareth
Hi Gareth,
I have created a workflow in FME that allows users to "check out" or "return" a license without having to ask an administrator. The workflow requires us to update the role and the license type in two steps. there are two options - if the user checks out a license I set their named user to fieldWorkerUT and the corresponding custom role and if the user returns a license I set them to viewerUT and the corresponding custom viewer role.
First update License Type:
Request URL: $(arcgis_portal_url)/$(arcgis_portal_webadaptor_context)/sharing/rest/portals/0123456789ABCDEF/updateUserLicenseType
Method: POST
Parameters:
new_user_type = fieldWorkerUT or viewerUT
Second update User Role:
URL: $(arcgis_portal_url)/$(arcgis_portal_webadaptor_context)/sharing/rest/portals/0123456789ABCDEF/updateUserRole
new_role = 7Wqt2kdDEMSska9w or 3Fg8KwpdZknhNZE6 depending upon which one matches the license type that was selected first.
I hope this helps,
Marc
Hi there @Thomas_Z2
I saw your posting on the updateUserLicenseType Rest API call, and was wondering if you would mind sharing a code snippet of sorts to help me out here. I've been trying to find the way to update a user on the fly via the back-end, and this seems to be the way to do it - and as you've mentioned, Esri have not really documented anything about it!
I've tinkered with the url request ../arcgis/sharing/rest/portals/self/updateUserLicenseType?... but I'm yet to find a valid url that actually works.
I'll also take a look at the Python approach you've mentioned, but I'd rather hit it with a Rest call to be honest.
Any help truly appreciated (in either Rest, or Python cases)
thanks in advance
Thanks so much for updating this thread with what you found. 😀
Is this what you are after?
portal/sharing/rest/portals/0123456789ABCDEF/updateUserRole
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.