I am attempting to set member categories for individual members using the ArcGIS API for Python in Notebook Server for Portal.
The API docs and posts in the community state that it should be possible to use the "update" method to assign categories to a member. arcgis.gis module | ArcGIS API for Python
The update method has an argument for "categories" as shown in the highlight below.
But, when attempting to assign a property to the argument using the code below, I get the following error.
users = gis.users.search('zrobinson')
users[0].update(categories=['/Categories/ITS'])
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/tmp/ipykernel_188/103280399.py in <module>
----> 1 users[0].update(categories=['/Categories/ITS'])
TypeError: update() got an unexpected keyword argument 'categories'
However, I can use the same code to update other properties for the user such as description, name, etc. So the update method is recognized but for some reason does not recognize the "categories" argument.
Has anyone had success updating the categories for a user? Someone claimed success in this related post: Solved: Python Assign User Category - Esri Community
Solved! Go to Solution.
Thanks, Jake. You seem to have found the problem. I'm running the script from our Enterprise Notebook Server and the API version is 1.9.1. I assumed it was using the latest API. Do you know how to ensure Notebook Server is using the latest API?
You can disregard. I spoke with our GIS Admin. We just need to upgrade our Notebook Server. Thanks for pointing me in the right direction!