According to the API docs for User object there is a 'report' function. https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.User
I have an Administrator user role.
When I attempt to get a report for a user as shown below...
from arcgis.gis import GIS
import datetime as _dt
## connect to portal
agol = GIS("home")
## logged in user - returns a User object
user = agol.users.me
## https://developers.arcgis.com/python/api-reference/arcgis.gis.toc.html#arcgis.gis.User
seven_days_ago = _dt.datetime.now(_dt.timezone.utc) - _dt.timedelta(days=7)
item = user.report("content", seven_days_ago, duration="weekly")
print(item)
I get the following error...
Traceback (most recent call last):
File "C:\ArcGISPro\envs\arcgispro-py3-nbi\lib\site-packages\arcgis\gis\__init__.py", line 7272, in __getattr__
return dict.__getitem__(self, name)
KeyError: 'report'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<module2>", line 12, in <module>
File "C:\ArcGISPro\envs\arcgispro-py3-nbi\lib\site-packages\arcgis\gis\__init__.py", line 7274, in __getattr__
raise AttributeError("'%s' object has no attribute '%s'" % (type(self).__name__, name))
AttributeError: 'User' object has no attribute 'report'
Has anyone successfully ran a user report using this method?
report