I'm attempting to access and manage users in our HUB community account with the python API. I'm using our only sign-in credentials.
gis = GIS("https://countyhub.maps.arcgis.com", "username", "password")
To get the number of members I use:
hub_users = gis.users.search()
number = len(hub_users)
number
#prints
100
I don't know where it gets the 100? Our Members page says we have 538 enabled members with any sort of role.
Then I attempt to gather some info with the search queries and I'm blocked by an Exception.
# anonymous connection to ArcGIS Online
ago_gis = GIS()
# # search the users whose email address ends with esri.com
esri_public_accounts = ago_gis.users.search(query='email = @esri.com')
len(esri_public_accounts)
Exception: You do not have permissions to access this resource or perform this operation. (Error Code: 403)
Additionally, I've tried with my AGOL sign-in credentials. It also throws the same Exception with querying.