Hello, I have 2 questions about accessing users and their assigned categories in ArcGIS Online through python:
1. I'm trying to query all the users who haven't been assigned a category. This is what I first tried:
users = gis.users.search(query='categories:""', max_users=1000)
It returned users who weren't categorized as well as 2 full user categories. Is this the incorrect method of searching for unassigned users? I also tried searching with query='None' but the result was an empty list.
The next thing I tried was using NOT in my filters. My logic was to use search(NOT (Category A OR Category B OR Category C)), in order to find the users without a category. I was trying to follow the California NOT Imagery examples here https://doc.arcgis.com/en/arcgis-online/reference/advanced-search.htm but am getting a Syntax Error: invalid syntax.
users = gis.users.search(query='categories:""' NOT 'categories:"/Categories/Pets"', max_users=1000)
Could I ask how to search for users without a category assigned to them?
2. Is there a way to assign users a category through python? I couldn't find any documentation on how to do this through the API.
Thank you!