Skip To Content

/history: Portal History

  • URL:https://[root]/portals/[portalID]/history

Example usage

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

https://org.arcgis.com/sharing/rest/portals/0123456789ABCDEF/history?num=25&types=g,i&f=pjson

Description

Note:

This endpoint is only supported for ArcGIS Online organizations.

Allows the organization administrator 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

num=50
start

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

Example

start=eyJjcmVhdGVkIjp7Ik4iOiIxNTM1NjMwMjA1OTI3In0sImlkIjp7IlMiOiIxODhkYzUzMWZkNDI0MWVhYmNhZTllY2ZkNTRjNWU5ZSJ9LCJvcmdJZCI6eyJTIjoiTGtGeXhiOXpEcTd2QU9BbSJ9fQ
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

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

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.

Examples

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

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:

[
    {
      "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

/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

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

arcgispro
data

Request parameter information used to take the action where applicable.

Example

{"everyone":false,"org":true,"groups":[]}

JSON Response syntax


{
  "num": <num of results>,
  "nextKey": "<next key>",
  "items": [
    {
      "<event 1 obj>"
    },
    {
      "<event 2 obj>"
    },
    {
      "<event 3 obj>"
    },
    {
      "<event 4 obj>"
    }
  ]
}

JSON Response example


{
  "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\":[]}"
    }
  ]
}