Differences
- URL: https://<version-url>/differences
- Version Introduced:10.6
Description
The Differences operation allows you to discover what edits have been performed in the current version. Differences or edits performed in the default version can also be discovered 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
Parameter | Details |
---|---|
f | Description: Optional parameter specifying the output format of the response. The default response format is html. Values: html | json |
sessionId | Description: The client-generated session ID (GUID); a required parameter. Syntax : sessionId = {3F2504E0-4F89-41D3-9A0C-0305E82C3301} |
fromMoment | Description: Optional parameter specifying the moment of the version to obtain the differences from. This parameter returns differences between the specified fromMoment and moment parameters.
This parameter was introduced at ArcGIS Enterprise 10.9. Syntax : fromMoment = 1603109596000 |
moment | Description: Optional parameter specifying the moment used for the version to obtain the differences. When not specified, the current branch moment of the version is used instead. The input moment must be greater than the version's common ancestor moment. When 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 = 1603109606000 |
resultType | Description: Optional parameter specifying the type of results to return. The default result type is objectIds. Values : "objectIds" | "features" |
layers | Description: Optional parameter representing the array of layer IDs for which differences to return. If not specified, differences for all layers will be returned. This parameter was introduced at ArcGIS Enterprise 10.9.1. Syntax: layers = [<long>] Example: layers = [6] |
async | Description: If true, the request is processed as an asynchronous job, and a URL is returned that a client can visit to check the status of the job. The default is false. Values: true | false This parameter was introduced at ArcGIS Enterprise 10.9.1. |
JSON Response syntax
JSON response (when async = false):
{
"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):
{
"statusUrl" :
}
JSON response to the status URL (when pending or in progress):
{
"status" : "",
"submissionTime" : ,
"lastUpdatedTime" :
}
Example usage
Use the differences operation to see the edits between a named version and the default.
Request URL and parameters:
https://myserver.esri.com/server/rest/services/LandUse/VersionManagementServer/versions/24417758-0DBD-4EC3-95B0-467CAA47FC43/differences
f=json
sessionID={638ed440-b81f-406c-bd5d-757c91dbfd70}
resultType=objectids
async=false
JSON response:
{
"differences": [
{
"layerId": 1,
"updates": [
21,
30
]
}
],
"success": true
}