/history: Portal History

URL:
https://[root]/portals/[portalID]/history
Methods:
GET

Example usage

The following is a sample ArcGIS Online request URL used to access the history resource:

Use dark colors for code blocksCopy
1
https://org.arcgis.com/sharing/rest/portals/0123456789ABCDEF/history?num=25&types=g,i&f=pjson

Description

The history resource allows organization administrators to query historical events that have occurred in an ArcGIS Online organization. When the output format is CSV, only the first 10,000 records can be included.

Request parameters

ParameterDetails

num

The maximum number of history events to be included in each batch of result set. The default is 25, and the maximum allowed is 100.

Note that the actual number of returned results may be fewer than num; this happens when the number of results remaining is fewer than num.

If the output format is CSV (in other words, f=csv), num is the maximum number of total events to be included in the result CSV file (up to 10,000 records); start no longer applies.

Example

Use dark colors for code blocksCopy
1
num=50

start

Used with nextKey from the response to get the next batch of events.

Example

Use dark colors for code blocksCopy
1
2
3
start=eyJjcmVhdGVkIjp7Ik4iOiIxNTM1NjMwMjA1OTI3In0sImlkIjp7Il
MiOiIxODhkYzUzMWZkNDI0MWVhYmNhZTllY2ZkNTRjNWU5ZSJ9LCJvcmdJ
ZCI6eyJTIjoiTGtGeXhiOXpEcTd2QU9BbSJ9fQ

all

If true, all types of events are included. The default is false, with only actions targeted by the organization included (for example, idType is a for all events). Set the parameter to true when the output format is CSV.

Values: true | false

id

Filter events by specific target user name or target ID in a batch result set. It can be the ID of an item, a group, a role, a collaboration, an identity provider, and so on.

Example

Use dark colors for code blocksCopy
1
2
3
4
id=jsmith

//or
id=67387f9ead814880bfb1ead7f76e5386

types

Filter events by a comma-separated list of target types in a batch result set.

Values: a (organization) | c (collaboration) | cp (collaboration participate) | cpg (collaboration participate group) | cw (collaboration workspace) | cwp (collaboration workspace participate) | g (group) | i (item) | idp (identity provider) | inv (invitation) | r (role) | u (user)

actors

Filter events by a comma-separated list of user names who take the actions in a batch result set.

Example

Use dark colors for code blocksCopy
1
actors=jsmith,kevinb,andrewo

owners

Filter events by a comma-separated list of user names who own the action targets in a batch result set.

actions

Filter events by a comma-separated list of action types in a batch result set.

Values: add | addusers | create | delete | removeusers | share | unshare | update | login | updateUsers

fromDate

Filter events starting from a specific time frame in ISO 8601 format or UNIX time in milliseconds.

Example

Use dark colors for code blocksCopy
1
2
3
fromDate=2017-09-01
//or
fromDate=1504249200000

toDate

Filter events that occurred before a specific time frame in ISO 8601 format or UNIX time in milliseconds.

ips

Filter events by a comma-separated list of IP addresses in a batch result set.

sortOrder

Describes whether the results return in ascending or descending chronological order. The default is ascending.

Values: asc | desc

f

The response format. The default format is html.

Values: html | json | pjson | csv

Response properties

PropertyDetails

num

The number of results included in the result set of the response.

Example

Use dark colors for code blocksCopy
1
num=100

nextKey

Used to fetch the next batch of events by calling with the start parameter.

items

A JSON array of event items; each event is detailed with properties described in the Items Properties section.

Example

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
[
  {
    "id": "J423vH8fR9HV444l",
    "idType": "a",
    "orgId": "J423vH8fR9HV444l",
    "created": 1454520118902,
    "actor": "mattp",
    "action": "update",
    "ip": "172.16.254.1",
    "request": "/sharing/rest/portals/self/update",
    "reqId": "e92b4effff914fd68430995c95395b7b",
    "appId": "arcgisonline"
  },
  {
    "id": "J423vH8fR9HV444l",
    "idType": "a",
    "orgId": "J423vH8fR9HV444l",
    "created": 1454524502609,
    "actor": "michaelh",
    "action": "update",
    "ip": "172.16.254.1",
    "request": "/sharing/rest/portals/self/update",
    "reqId": "ac8127b5015b491bb337573c1e7fd2f0"
    "appId": "arcgisonline"
  }
]

Items properties

PropertyDetails

id

Target user name or ID.

idType

The type of the ID in the id field.

Values: a (organization) | c (collaboration) | cp (collaboration participate) | cpg (collaboration participate group) | cw (collaboration workspace) | cwp (collaboration workspace participate) | g (group) | i (item) | idp (identity provider) | inv (invitation) | r (role) | u (user)

orgId

Organization ID.

owner

The owner of the target.

created

The UNIX time stamp in milliseconds when the event was logged.

actor

The actor of the event.

action

Type of action.

Values: add | addusers | create | delete | removeusers | share | unshare | update | login | updateUsers

ip

Actor's IP address.

request

Operation requested by the actor.

Example

Use dark colors for code blocksCopy
1
/sharing/rest/content/users/jsmith/shareItems

reqId

The unique identifier used to identify certain event logs together to indicate them as "one action" triggered by the actor, in other words, removing members from a group also unshares their items from the group, or bulk share multiple items altogether.

Example

Use dark colors for code blocksCopy
1
eb98161d3a8e40fcb71960480f431abb

clientId/appId

ID of the client app where the action was performed on or by the target, for example, a target user signed into ArcGIS Online from ArcGIS Pro.

Example

Use dark colors for code blocksCopy
1
arcgispro

data

Request parameter information used to take the action where applicable.

Example

Use dark colors for code blocksCopy
1
{"everyone":false,"org":true,"groups":[]}

JSON Response syntax

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
  "num": <num of results>,
  "nextKey": "<next key>",
  "items": [
    {
      "<event 1 obj>"
    },
    {
      "<event 2 obj>"
    },
    {
      "<event 3 obj>"
    },
    {
      "<event 4 obj>"
    }
  ]
}

JSON Response example

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{
  "num": 25,
  "nextKey": "eyJjcmVhdGVkIjp7Ik4iOiIxNTM1NTYxOTU0MzI1In0sImlkIjp7IlMiOiI3ZThmNTM4Zjg2NWE0YWQ4YTlmYTFjODJkNDg3YzEyMyJ9LCJvcmdJZCI6eyJTIjoiSjQyM3ZIOGZSOUhWNDQ0ayJ9fQ",
  "items": [
    {
      "id": "93744920722644fcb926044f2cf327f6",
      "idType": "g",
      "orgId": "J423vH8fR9HV444l",
      "owner": "jsmith",
      "created": 1535671479677,
      "actor": "jsmith",
      "action": "removeusers",
      "ip": "172.16.254.1",
      "request": "/sharing/rest/community/groups/93744920722644fcb926044f2cf327f6/removeUsers",
      "reqId": "563c69aae3474d729aa3db8a4d71a7da",
      "appId": "arcgisonline",
      "data": "{\"users\":[\"[user1, user2, user3, user4]\"]}"
    },
    {
      "id": "7b2a7f54b5e34a6495f4aef3a877d1d3",
      "idType": "i",
      "orgId": "J423vH8fR9HV444l",
      "owner": "user3",
      "created": 1535671479676,
      "actor": "jsmith",
      "action": "unshare",
      "ip": "172.16.254.1",
      "request": "/sharing/rest/community/groups/93744920722644fcb926044f2cf327f6/removeUsers",
      "reqId": "563c69aae3474d729aa3db8a4d71a7da",
      "appId": "arcgisonline",
      "data": "{\"groups\":[\"93744920722644fcb926044f2cf327f6\"]}"
    },
    {
      "id": "c1ef98d5330144f6a76e11c06d64de5d",
      "idType": "i",
      "orgId": "J423vH8fR9HV444l",
      "owner": "jsmith",
      "created": 1535572693781,
      "actor": "jsmith",
      "action": "share",
      "ip": "172.16.254.1",
      "request": "/sharing/rest/content/users/jsmith/shareItems",
      "reqId": "be1f4f2992a34c9f96cdae67137f52a5",
      "appId": "arcgisonline",
      "data": "{\"everyone\":true,\"org\":true,\"groups\":[]}"
    },
    {
      "id": "803c713119084d069c9b2d86575762c7",
      "idType": "i",
      "orgId": "J423vH8fR9HV444l",
      "owner": "jsmith",
      "created": 1535572693781,
      "actor": "jsmith",
      "action": "share",
      "ip": "172.16.254.1",
      "request": "/sharing/rest/content/users/jsmith/shareItems",
      "reqId": "be1f4f2992a34c9f96cdae67137f52a5",
      "appId": "arcgisonline",
      "data": "{\"everyone\":true,\"org\":true,\"groups\":[]}"
    }
  ]
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.