Hello,
I am getting the same error. However I am trying to add a layer to an existing service via javascript code. I am passing the following parameters to the api.
I am referring to the sample code in:
Add to Definition (Feature Service)—ArcGIS REST API: Services Directory | ArcGIS for Developers
Sample code:
const options = {
query:
{
"layers": [
"adminLayerInfo": {
"tableName": "db_10.user_10.LOADTESTSOIL_LOADTESTSOIL",
"geometryField": {"name": "Shape"},
"xssTrustedFields": ""
},
"name": "LoadTestSoil",
"type": "Feature Layer",
"displayField": "",
"description": "",
"copyrightText": "",
"defaultVisibility": true,
"ownershipBasedAccessControlForFeatures": {
"allowOthersToQuery": false,
"allowOthersToDelete": false,
"allowOthersToUpdate": false
},
"editFieldsInfo": {
"creationDateField": "CreationDate",
"creatorField": "Creator",
"editDateField": "EditDate",
"editorField": "Editor"
},
"editingInfo": {
"lastEditDate": "1455126059440"
},
"relationships": [],
"isDataVersioned": false,
"supportsCalculate": true,
"supportsAttachmentsByUploadId": true,
"supportsRollbackOnFailureParameter": true,
"supportsStatistics": true,
"supportsAdvancedQueries": true,
"supportsValidateSql": true,
"supportsCoordinatesQuantization": true,
"supportsApplyEditsWithGlobalIds": true,
"advancedQueryCapabilities": {
"supportsPagination": true,
"supportsQueryWithDistance": true,
"supportsReturningQueryExtent": true,
"supportsStatistics": true,
"supportsOrderBy": true,
"supportsDistinct": true,
"supportsQueryWithResultType": true,
"supportsSqlExpression": true,
"supportsReturningGeometryCentroid": true
},
"useStandardizedQueries": false,
"geometryType": "esriGeometryPolygon",
"minScale": 2311163,
"maxScale": 1128,
"extent": {
"xmin": -13090714.767112788,
"ymin": 3841739.0914657288,
"xmax": -12922032.654624918,
"ymax": 3962581.2727843975,
"spatialReference": {
"wkid": 102100,
"latestWkid": 3857
}
},
"drawingInfo":{"renderer":{"type":"simple","symbol":{"type":"esriSFS","style":"esriSFSSolid","color":[76,129,205,191],"outline":{"type":"esriSLS","style":"esriSLSSolid","color":[0,0,0,255],"width":0.75}}},"transparency":0,"labelingInfo":null},
"allowGeometryUpdates": true,
"hasAttachments": false,
"htmlPopupType": "esriServerHTMLPopupTypeNone",
"hasM": false,
"hasZ": false,
"objectIdField": "FID",
"globalIdField": "GlobalID",
"typeIdField": "",
"fields": [
{
"name": "FID",
"type": "esriFieldTypeInteger",
"actualType": "int",
"alias": "FID",
"sqlType": "sqlTypeInteger",
"length": 4,
"nullable": false,
"editable": false,
"domain": null,
"defaultValue": null
},
{
"name": "SHP_ID_ARE",
"type": "esriFieldTypeDouble",
"actualType": "float",
"alias": "SHP_ID_ARE",
"sqlType": "sqlTypeFloat",
"nullable": true,
"editable": true,
"domain": null,
"defaultValue": null
}
],
"types": [],
"supportedQueryFormats": "JSON",
"hasStaticData": false,
"maxRecordCount": 1000,
"standardMaxRecordCount": 4000,
"tileMaxRecordCount": 4000,
"maxRecordCountFactor": 1,
"capabilities": "Create,Delete,Query,Update,Editing,Extract,Sync",
"exceedsLimitFactor"
}
]
}
Any help would be appreciated. Thanks.
Best,
Prutha