- URL:
- https://<root>/<serviceName>/FeatureServer/<layerId>/addFeatures
- Methods:
POST
- Required Capability:
- Create
- Version Introduced:
- 10.0
Description
This operation adds features to the associated feature layer or table (POST only). The add
operation is performed on a feature service layer resource.
The operation returns the results of the edits in an array of edit result objects. Each edit result identifies a single feature and indicates if the inserts were successful or not. If not, it also includes an error code and an error description.
You can provide arguments to the add
operation as defined in the following parameters table:
New at 10.9
A new parameter, time
, has been added at 10.9. Setting time
as true
indicates that the client is capable of working with date field data values that are not in UTC. For more information on this parameter, see the Request parameters table below.
Request parameters
Parameter | Details |
---|---|
| The array of features to be added. The structure of each feature in the array is the same as the structure of the json feature object returned by the ArcGIS REST API. Features to be added to a feature layer should include the geometry. Records to be added to a table should not include the geometry. Syntax
Example
|
|
The geodatabase version to apply the edits. This parameter applies only if the If the Syntax: Example: |
(Optional) | This option was added at 10.5 and works with ArcGIS Enterprise services only. Optional parameter specifying whether the response will report the time features were added. If Values: |
|
Specifies whether the edits should be applied only if all submitted edits succeed. If Not all data supports setting this parameter. Query the Values: Example: |
| Setting Its possible to define a service's time zone of date fields as unknown. Setting the time zone as unknown means that date values will be returned as-is from the database, rather than as date values in UTC. Non-hosted feature services can be set to use an unknown time zone using ArcGIS Server Manager. Setting the time zones to unknown also sets the Most clients released prior to ArcGIS Enterprise 10.9 will not be able to work with feature services that have an unknown time setting. Newer clients, such as ArcGIS Pro 2.7, can work with specific operations, such as the Value: |
|
The response format. The default response format is Values: |
Example usage
Add an array of features using the add
operation on a feature service layer resource:
https://services.myserver.com/ERmEceOGq5cHrItq/ArcGIS/rest/services/SanFrancisco/311Incidents/FeatureServer/0/addFeatures
Sample input array for features
:
features=[
{
"attributes" : {
"req_id" : "508389",
"req_type" : "Graffiti Complaint - Public Property",
"req_date" : "09\/19\/2009",
"req_time" : "18:44",
"address" : "11TH ST and HARRISON ST",
"x_coord" : "6008925.0",
"y_coord" : "2108713.8",
"district" : "6",
"status" : 1
},
"geometry" : {
"x" : -122.41247978999991,
"y" : 37.770630098000083
}
}
]
JSON Response syntax
{
"addResults": [
{
"objectId": <objectId1>,
"globalId": <globalId1>,
"success": <true | false>,
"error": { //only if success is false
"code": <code1>,
"description": "<description1>",
}
},
{
"objectId": <objectId2>,
"globalId": <globalId2>,
"success": <true | false>,
"error": { //only if success is false
"code": <code2>,
"description": "<description2>",
}
}
]
}
JSON Response example
{
"addResults": [
{
"objectId": 617,
"success": true
},
{
"success": false,
"error": {
"code": -2147217395,
"description": "Setting of Value for depth failed."
}
}
]
}