Differences

URL:
https://<root>/<serviceName>/VersionManagementServer/versions/<versionGuid>/differences
Methods:
POST
Required Capability:
ArcGIS Advanced Editing user type extension license
Version Introduced:
10.6

Description

The differences operation allows you to review the edits that have been made to the current version. The differences, or edits made, in the default version can also be reviewed between two moments. The output will provide the edits performed in each layer and return the changes in the following categories:

  • Inserts—Features that have been created in the version that did not exist when the version was created
  • Updates—Features that have been updated in the version
  • Deletes—Features that have been deleted in the version that were present when the version was created

The differences operation is supported both synchronously and asynchronously.

Request parameters

ParameterDetails

f

Specifies the output format of the response. The default response format is html.

Values: html | json | pjson

sessionId (Optional)

The client-generated sessionId (GUID).

Syntax : sessionId = {3F2504E0-4F89-41D3-9A0C-0305E82C3301}

fromMoment (Optional)

The moment of the version from which the differences will be obtained. This parameter returns the differences between the specified fromMoment and moment parameter values. This parameter is optional.

  • If this parameter is not provided, the differences operation returns the edits (inserts, updates, and deletes) at the value of the specified moment parameter by default.

  • This parameter is only supported on the default version. If this parameter value is provided for a named branch, an error will be returned. The common ancestor moment is automatically used.

Syntax: fromMoment = <Epoch time in seconds>

Example: fromMoment = 1603109596000

This parameter was introduced at ArcGIS Enterprise 10.9.

moment (Optional)

The moment used for the version to obtain the differences. If this parameter value is not provided, the current branch moment of the version will be used. This parameter is optional.

The input moment must be greater than the version's common ancestor moment. In an edit session with unsaved edits, using a moment larger than the version's current moment will also return differences in the edit session.

Syntax: moment = <Epoch time in seconds>

Example: moment = 1603109606000

resultType (Optional)

Specifies the type of results that will be returned. The default result type is objectIds. This parameter is optional.

Values : objectIds | features

layers (Optional)

The array of layer IDs for which differences will be returned. If no value is provided, the differences for all layers will be returned. This parameter is optional

Syntax: layers = [<long>] Example: layers = [6]

This parameter was introduced at ArcGIS Enterprise 10.9.1.

async (Optional)

Specifies whether the request will be processed asynchronously. If true, the request will be processed as an asynchronous job, and a URL will be returned that a client can visit to review the status of the job. The default is false.

Values: true | false

This parameter was introduced at ArcGIS Enterprise 10.9.1.

outSR (Optional)

The output spatial reference.

Syntax: {wkid=<wkid>}

Example: outSR = {wkid=4326}

This parameter was introduced at ArcGIS Enterprise 11.1.

JSON Response syntax

JSON response (when async = false):

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
{
  "differences" : [
    {
      "layerId" : long,
      "inserts" : [ <objectId> ],
      "updates" : [ <objectId> ],
      "deletes" : [ <objectId> ]
    }
  ],
  "features" : [
    {
      "layerId" : long,
      "inserts" : [
        {
          "attributes" : {
            "OBJECTID" : 581,
            "SUBTYPE" : 3,
             . . .
            "SHAPE.STLength()" : 132.5
          },
          "geometry" : {
            "hasZ" : true,
            "hasM" : true,
            "paths" : [
              . . .
            ]
          }
        }
      ],
      "updates" : [
      ],
      "deletes" : [
      ]
    }
  ],
  "success" : <true | false>,
  "error" : { // only if success is false
    "extendedCode" : <HRESULT>,
    "message" : "<error message>",
    "details" : [ <detail> ]
  }
}

JSON response (when async = true):

Use dark colors for code blocksCopy
1
2
3
{
  "statusUrl" : <url>
}

JSON response to the status URL (when pending or in progress):

Use dark colors for code blocksCopy
1
2
3
4
5
{
  "status" : "<Pending | InProgress>",
  "submissionTime" : <datetime>,
  "lastUpdatedTime" : <datetime>
 }

Example usage

Use the differences operation to review the edits between a named version and the default version.

Request URL and parameters:

https://myserver.esri.com/server/rest/services/LandUse/VersionManagementServer/versions/24417758-0DBD-4EC3-95B0-467CAA47FC43/differences

Use dark colors for code blocksCopy
1
2
3
4
f=json
sessionId={638ed440-b81f-406c-bd5d-757c91dbfd70}
resultType=objectids
async=false

JSON response:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
{
 "differences": [
  {
   "layerId": 1,
   "updates": [
    21,
    30
   ]
  }
 ],
 "success": true
}

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