Write Errors

URL:
https://<root>/<serviceName>/ValidationServer/writeErrors
Methods:
POST
Version Introduced:
11.3

Description

The writeErrors operation writes an error result or a missing feature result to the GDB_Validation*Errors tables using the specified version and session ID. The only supported category parameter values are featureErrors or missingFeatureErrors. The number of new errors written into the table along with the moment is returned. All other values will result in a NO-OP and create a JSON error response.

Learn more about enabling visual review for branch versions

Request parameters

ParameterDetails

f

An optional parameter to specify the output format of the response. The default is html.

Values: html | json

category (Required)

The featureErrors category parameter writes errors for features in a layer similar to the Browse Features visual review tool. The missingFeatureErrors category parameter writes errors for missing features in a layer, similar to the Flag Missing Features visual review tool.

Values: featureErrors | missingFeatureErrors

Example: category=featureErrors

gdbVersion (Optional)

This parameter specifies the name of the geodatabase version where default is DEFAULT.

Use dark colors for code blocksCopy
1
Syntax: `gdbVersion=<version>`
Use dark colors for code blocksCopy
1
Example: gdbVersion=SDE.DEFAULT

sessionID (Optional)

This parameter specifies the token (guid) used to lock the version. If the calling client edits a named version, the sessionId must be provided. If the client edits DEFAULT, the version may not be locked and the sessionId should not be specified.

Use dark colors for code blocksCopy
1
Example: sessionID={E81C2E2D-C6A7-40CB-BF61-FB499E53DD1D}

errors (Required)

This parameter represents a JSON array of layers and errors to add to the appropriate validation error table (GDB_ValidationPointErrors, GDB_ValidationPolygonErrors, or GDB_ValidationLineErrors), depending on the geometry type of the source layer.

The following is a list of acceptable values:

  • id —This required property represents the id of the layer.

  • errorFeatures —This required property represents a JSON array of errors for the specified layer grouped by errorType.

  • errorType —This required property represents the error type that best describes the errors in the data. The following are the supported error type values: missingFeature | addFeature | changeSubType | deleteFeature | moveFeature | reshapeArea | reshapeLine | custom

  • geometries —This is a required property when the category is set as missingFeatureErrors to indicate the location of missing features. This is an array of geometries that correspond to the specified layer. Point geometries are supported as error geometries starting at ArcGIS Enterprise 11.3. Point, line, and polygon geometries are supported as error geometries at the 11.4 release.
  • objectIds —An array of feature Object IDs from the specified layer. The feature geometry will be stored as an error in the corresponding GDB_Validation*Errors tables for the specified layer and error type. This is only valid when the category parameter is set as featureErrors.

  • objectIdSketchGeometryPairs —An array of feature Object IDs and corresponding user sketched geometries from the specified layer. The sketched geometry will be stored as an error in the corresponding GDB_Validation*Errors tables for the specified layer and error type. The property is only valid when the category is set as featureErrors.

  • errorMessage —This optional property represents the error description of the errors for the specified layer and error type. If the user does not specify any value, the default description is the error type's string.
  • severity —This optional property represents the severity of errors for the specified layer and error type. The default severity value is 3.

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
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
[
    {
        "id" : <layerId>,
        "errorFeatures" : [
			{
				"errorType" : <value>,
				"objectIds" : [<objectId>],
				"errorMessage" : <value>,
				"severity" : <value>
			},
			{
				"errorType" : <value>,
				"objectIdSketchGeometryPairs": [
					{
						"objectId": <objectId>,
						"geometry": {<geometry>}
					},
					{
						"objectId": <objectId>,
						"geometry": {<geometry>}
					}
				],
				"errorMessage" : <value>,
				"severity" : <value>
			}
        ]

    },
    {
        "id" : <layerId2>,
        "errorFeatures" : [
			{
				"errorType" : <value>,
				"objectIds" : [<objectId>],
				"errorMessage" : <value>,
				"severity" : <value>
            }
        ]
    }
]

returnEdits (Optional)

This Boolean property specifies whether to return modified features. Returned results are organized in a layer-by-layer fashion. If returnEdits is set to true, then each layer may have edited features returned in an editedFeatures object.

The editedFeatures object returns full features including the original and current features for updates; and the current rows for inserts.

If the count of edited features to return is more than the maxRecordCount value the response will not include editedFeatures values and exceededTransferLimit will return as true. If clients are using this parameter to maintain a cache, they should invalidate the cache when exceedTransferLimit is returned as true. If the server encounters an error when generating the list of edits in the response, exceedTransferLimit is also returned as true.

Edited features are returned in the spatial reference of the feature service as defined by the services spatialReferenceObject.

The default value for this parameter is false.

Values: true | false

JSON Request Examples

Example one: featureErrors request at 11.3

The following is a sample POST request for the writeErrors operation when the category is set to featureErrors.

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
[
	{
		"id": 0,
		"errorFeatures": [
			{
				"errorType": "addFeature",
				"objectIds": [1,2],
				"errorMessage": "Add Feature",
				"severity": 3
			},
			{
				"errorType": "deleteFeature",
				"objectIds": [3,4,5],
				"errorMessage": "Delete Feature",
				"severity": 2
			},
			{
				"errorType": "moveFeature",
				"objectIds": [6,7],
				"errorMessage": "Move Feature",
				"severity": 3
			},
			{
				"errorType": "reshapeLine",
				"objectIds": [8],
				"errorMessage": "Reshape Line",
				"severity": 5
			},
			{
				"errorType": "reshapeArea",
				"objectIds": [9,10],
				"errorMessage": "Reshape Area",
				"severity": 5
			},
			{
				"errorType": "changeSubtype",
				"objectIds": [11,12,13],
				"errorMessage": "Change Subtype",
				"severity": 3
			}
		]
	},
	{
		"id": 1,
		"errorFeatures": [
			{
				"errorType": "addFeature",
				"objectIds": [8304,8305],
				"errorMessage": "Add Feature",
				"severity": 3
			}
		]
	}
]

Example two: featureErrors request at 11.4

The following is a sample POST request for the writeErrors operation when the category is set to featureErrors and objectIdSketchGeometryPairs is utilized.

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
[
    {
        "id" : 0,
        "errorFeatures" : [
			{
				"errorType" : "addFeature",
				"objectIds" : [14,15],
				"errorMessage" : "Add to these features",
				"severity" : 2
			},
			{
				"errorType" : "moveFeature",
				"objectIdSketchGeometryPairs": [
					{
						"objectId": 16,
						"geometry": {"x":-88.17808016299995,"y":41.74971413500003}
					},
					{
						"objectId": 17,
						"geometry": {"paths": [[[-97.06138, 32.837],[-97.06133, 33.836],[-98.2, 34.834],[-97, 40]]]}
					}
				],
				"errorMessage" : "Move Feature",
				"severity" : 1
			}
        ]

    },
    {
        "id" : 1,
        "errorFeatures" : [
			{
				"errorType" : "reshapeLine",
				"objectIds" : [8302],
				"errorMessage" : "Reshape this feature to match reference imagery",
				"severity" : 2
            }
        ]
    }
]

Example three: missingFeatureErrors request at 11.3

The following is a sample POST request for the writeErrors operation when the category is set to missingFeatureErrors.

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
[
   {
      "id":0,
      "errorFeatures":[
         {
            "errorType":"missingFeature",
            "geometries":[{"x":-143.501, "y":57.043}, {"x":-72.865, "y":-37.486}],
            "errorMessage":"Missing Feature",
            "severity":1
         }
      ]
   },
   {
      "id":1,
      "errorFeatures":[
         {
            "errorType":"missingFeature",
            "geometries" : [{"x":-118.152, "y":33.801}],
            "errorMessage" : "Missing address point",
            "severity" : 5
         }
      ]
   }
]

Example four: missingFeatureErrors request at 11.4

The following is a sample POST request for the writeErrors operation when the category is set to missingFeatureErrors and line and polygon error geometries are specified.

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
[
	{
        "id": 0,
        "errorFeatures": [
           {
                "errorType": "missingFeature",
				"geometries": [{"paths": [[[-96.06238, 31.837],[-96.06133, 32.836],[-97.2, 33.834],[-96, 39]]]}],
                "errorMessage": "Missing Fence",
                "severity": 3
           }
        ]
    },
	{
        "id": 1,
        "errorFeatures": [
           {
                "errorType": "missingFeature",
				"geometries": [{"rings":[[[-96.02, 31],[-97, 33],[-95, 35],[-96, 31]]]}],
                "errorMessage": "Missing Building Footprint",
                "severity": 3
           }
        ]
    }
]

JSON Response Examples

Example one: featureErrors response at 11.3

The following is a sample response returned when returnEdits is set as false (default).

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
{
	"moment": 1726164981839,
	"writeErrorResults": [
		{
			"id": 0,
			"errorLayerId": 4,
			"errors": [
				{
					"objectId": 1,
					"globalId": "{93992544-3642-461F-976F-9D364D73ECBD}",
					"errorType": "addFeature",
					"success": true
				},
				{
					...
				},
				{
					"objectId": 13,
					"globalId": "{DB91BFFC-6BD0-42E5-9A42-87F0B7A138D0}",
					"errorType": "changeSubType",
					"success": true
				}
			]
		},
		{
			"id": 1,
			"errorLayerId": 5,
			"errors": [
				{
					"objectId": 1,
					"globalId": "{BE820BF7-8C3D-4ACC-A8DE-F16A78A39812}",
					"errorType": "addFeature",
					"success": true
				},
				{
					"objectId": 2,
					"globalId": "{524F7E74-DCD4-483E-83ED-892F0C49104D}",
					"errorType": "addFeature",
					"success": true
				}
			]
		}
	],
	"success": true
}

Example two: featureErrors response at 11.4

The following is a sample response returned when returnEdits is set as true starting at the 11.4 release. The serviceEdits section provides details for the new errors created in the Error Layer table and documents the changes made to the fields in the applicable feature class.

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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
{
	"moment": 1726166556679,
	"writeErrorResults": [
		{
			"id": 0,
			"errors": [
				{
					"objectId": 14,
					"globalId": "{83C6637C-42BB-4E97-B90B-FA8969B0FBAA}",
					"errorType": "addFeature",
					"errorLayerId": 4,
					"success": true
				},
				{
					...
				},
				{
					"objectId": 26,
					"globalId": "{66439462-2FBF-435F-86AB-5C8B36AC10DD}",
					"errorType": "changeSubType",
					"errorLayerId": 4,
					"success": true
				}
			]
		},
		{
			"id": 1,
			"errors": [
				{
					"objectId": 3,
					"globalId": "{33136B86-FF75-4E1B-9AE1-6F7962EDF08A}",
					"errorType": "addFeature",
					"errorLayerId": 5,
					"success": true
				},
				{
					"objectId": 4,
					"globalId": "{6447F984-B6F8-4DA6-B939-2CF53494F257}",
					"errorType": "addFeature",
					"errorLayerId": 5,
					"success": true
				}
			]
		}
	],
	"exceededTransferLimit": false,
	"serviceEdits": [
		{
			"id": 0,
			"editedFeatures": {
				"spatialReference": {
					...
				},
				"updates": [
					[
						{
							"attributes": {
								"objectid": 1,
									...
								"lasteditor": "Esri",
								"globalid": "{51A88277-5E89-4174-BE28-94FA13BE246A}",
									...
								"last_edited_user": null,
								"last_edited_date": null,
								"validationstatus": 2
							},
							"geometry": {
								"x": 1020101.5865028277,
								"y": 1836530.9599222243
							}
						},
						{
							"attributes": {
								"objectid": 1,
									...
								"lasteditor": "Esri",
								"globalid": "{51A88277-5E89-4174-BE28-94FA13BE246A}",
									...
								"last_edited_user": "admin",
								"last_edited_date": 1726166556000,
								"validationstatus": 3
							},
							"geometry": {
								"x": 1020101.5865028277,
								"y": 1836530.9599222243
							}
						}
					],
					[
						...
					],
					[
						{
							"attributes": {
								"objectid": 13,
									...
								"lasteditor": "Esri",
								"globalid": "{2F4F06A5-373D-4BF1-8C92-582BFFDE2ECF}",
									...
								"last_edited_user": null,
								"last_edited_date": null,
								"validationstatus": 2
							},
							"geometry": {
								"x": 1022297.5380656384,
								"y": 1825868.8163023294
							}
						},
						{
							"attributes": {
								"objectid": 13,
									...
								"lasteditor": "Esri",
								"globalid": "{2F4F06A5-373D-4BF1-8C92-582BFFDE2ECF}",
									...
								"last_edited_user": "admin",
								"last_edited_date": 1726166556000,
								"validationstatus": 3
							},
							"geometry": {
								"x": 1022297.5380656384,
								"y": 1825868.8163023294
							}
						}
					]
				]
			}
		},
		{
			"id": 5,
			"editedFeatures": {
				"spatialReference": {
					...
				},
				"adds": [
					{
						"attributes": {
							"objectid": 3,
							"featureclassid": 40,
							"featureobjectid": 8305,
							"featureglobalid": "{9C0D5E65-667E-469B-912F-FC3D7B5D36AD}",
							"errornumber": 1001,
							"errormessage": "Browse Features Error",
							"ruletype": 2,
							"rulename": "Browse Features Rule",
							"ruleid": 1,
							"ruledescription": "Add Feature",
							"severity": 3,
							"isexception": 0,
							"errorstatus": 1,
							"errorphase": 2,
							"correctionnotes": null,
							"correctiontechnician": null,
							"verificationnotes": null,
							"verificationtechnician": null,
							"creationdate": 1726166556000,
							"creator": "admin",
							"lastupdate": 1726166556000,
							"updatedby": "admin",
							"globalid": "{33136B86-FF75-4E1B-9AE1-6F7962EDF08A}",
							"category": 11,
							"correctiondate": null,
							"verificationdate": null,
							"Shape__Length": 0.0016649158592712986
						},
						"geometry": {
							"hasZ": true,
							"hasM": true,
							"paths": [
								[
									[
										1033758.7708041441,
										1874256.0280146194,
										0,
										null
									],
									[
										1033903.5565376978,
										1874688.99406907,
										0,
										null
									],
									[
										1034002.340798491,
										1874695.4504524512,
										0,
										null
									]
								]
							]
						}
					},
					{
						"attributes": {
							"objectid": 4,
							"featureclassid": 40,
							"featureobjectid": 8304,
							"featureglobalid": "{46C7B30E-88F0-4360-97BD-6439D7C92C85}",
								...
						},
						"geometry": {
							...
						}
					}
				]
			}
		},
		{
			"id": 4,
			"editedFeatures": {
				"spatialReference": {
					...
				},
				"adds": [
					{
						"attributes": {
							"objectid": 14,
							"featureclassid": 41,
							"featureobjectid": 1,
							"featureglobalid": "{51A88277-5E89-4174-BE28-94FA13BE246A}",
							"errornumber": 1001,
							"errormessage": "Browse Features Error",
							"ruletype": 2,
							"rulename": "Browse Features Rule",
							"ruleid": 3,
							"ruledescription": "Add Feature",
							"severity": 3,
							"isexception": 0,
							"errorstatus": 1,
							"errorphase": 2,
							"correctionnotes": null,
							"correctiontechnician": null,
							"verificationnotes": null,
							"verificationtechnician": null,
							"creationdate": 1726166556000,
							"creator": "admin",
							"lastupdate": 1726166556000,
							"updatedby": "admin",
							"globalid": "{83C6637C-42BB-4E97-B90B-FA8969B0FBAA}",
							"category": 11,
							"correctiondate": null,
							"verificationdate": null
						},
						"geometry": {
							"x": 1020101.5864849248,
							"y": 1836530.9601007195,
							"z": 0,
							"m": null
						}
					},
					{
						...
					},
					{
						"attributes": {
							"objectid": 26,
							"featureclassid": 41,
							"featureobjectid": 13,
							"featureglobalid": "{2F4F06A5-373D-4BF1-8C92-582BFFDE2ECF}",
								...
						},
						"geometry": {
							...
						}
					}
				]
			}
		},
		{
			"id": 1,
			"editedFeatures": {
				"spatialReference": {
					...
				},
				"updates": [
					[
						{
							"attributes": {
								"objectid": 8304,
								"lasteditor": "Esri",
								"globalid": "{46C7B30E-88F0-4360-97BD-6439D7C92C85}",
								"last_edited_user": "User1",
								"last_edited_date": 1602016428000,
								"validationstatus": 2,
								"Shape__Length": 1035.2113882192219
							},
							"geometry": {
								"paths": [
									[
										...
									]
								]
							}
						},
						{
							"attributes": {
								"objectid": 8304,
									...
								"lasteditor": "Esri",
								"globalid": "{46C7B30E-88F0-4360-97BD-6439D7C92C85}",
									...
								"last_edited_user": "admin",
								"last_edited_date": 1726166556000,
								"validationstatus": 3,
								"Shape__Length": 1035.2113882192219
							},
							"geometry": {
								"paths": [
									[
										...
									]
								]
							}
						}
					],
					[
						{
							"attributes": {
								"objectid": 8305,
								"lasteditor": "Esri",
								"globalid": "{9C0D5E65-667E-469B-912F-FC3D7B5D36AD}",
								"last_edited_user": "User1",
								"last_edited_date": 1602016428000,
								"validationstatus": 2,
								"Shape__Length": 555.5283024199092
							},
							"geometry": {
								"paths": [
									[
									...
									]
								]
							}
						},
						{
							"attributes": {
								"objectid": 8305,
								"lasteditor": "Esri",
								"globalid": "{9C0D5E65-667E-469B-912F-FC3D7B5D36AD}",
								"last_edited_user": "admin",
								"last_edited_date": 1726166556000,
								"validationstatus": 3,
								"Shape__Length": 555.5283024199092
							},
							"geometry": {
								"paths": [
									[
										...
									]
								]
							}
						}
					]
				]
			}
		}
	],
	"success": true
}

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