The History endpoint of the REST API is a great tool to dig into information about events occurring in your organization. Although you easily download a comprehensive CSV of events as an administrator in ArcGIS Online, the REST API, provides the option to customize the data returned and to ask more specific questions. For an example of how to use the history CSV, check out this blog: https://www.esri.com/arcgis-blog/products/arcgis-/administration/exploring-the-organization-activity...
For this blog I am going to outline the query and results about a specific member of my ArcGIS Online organization.
Scenario: It’s time for Karate_Kelly’s year end review. She wants to prove to her boss that she has been busy creating and managing content in the organization. Using the History API, She’ll query all of the events that she has initiated in 2018.
Detective Steps:
- Formulate the Query
Url: https:/webapps.maps.arcgis.com/sharing/rest/portals/self/history?
Parameters:
all=true – returns events for all members in the organization
start=0 – Starts at the first record
num=10000 – largest amount of events returned (requires csv format)
f=csv – Returns result in a csv
sortOrder=asc – information output in ascending order
token = “6hVsODGfBpk5X_hGc0MOrnxmddIk4bL4hP8FyOAxM0QxL3VEw86iTdB” – admin token required
fromDate =2018-01-01 – start of date range
actors= Karate_KElly – events to be returned (Note, usernames are case sensitive, so if you hit a key by accident while creating your username, check the casing just to be sure... #Karate_KEllyIsNotAMistake)
Sample Url constructed:
https://webapps.maps.arcgis.com/sharing/rest/portals/self/history?all=true&start=0&actors=Karate_KElly&sortOrder=asc&fromDate=2018-01-01&num=10000&f=csv&token=Qian2inO2Cqf0tsljaLVJC5YbmjpQvg-CQ565QE75vesENzX5Yorf40K4ai_7fHn8
- Submit the request and view the resulting CSV
- Perform analysis or use pivot tables to provide insight into actions
Action | Count of Actions |
---|
Add | 412 |
Add Users | 7 |
Create | 12 |
Delete | 104 |
Failed Login | 15 |
Login | 192 |
Remove Users | 1 |
Share | 252 |
Update | 1448 |
Tracking my events by Month:
| Jan | Feb | March | April | May | June | July | Aug | Sept | Oct | Nov | Dec |
---|
# of Actions | 10 | 18 | 57 | 274 | 276 | 148 | 291 | 49 | 129 | 101 | 261 | 445 |
Test: When did I go on Summer vacation last year?
This is a neat way to look at your actions and your organizations members actions over time.
*Note. Only available in ArcGIS Online
https://community.esri.com/community/gis/web-gis/arcgisonline/blog/2019/03/16/generate-a-token?sr=se...