Update Definition (Feature Service)

Description

The updateDefinition operation supports updating a definition property in a hosted feature service. The result of this operation is a response indicating success or failure with error code and description.

Parameters

Parameter

Details

f

Description: The response format. The default response format is html.

Values: html | json | pjson

updateDefinition

Description: The service update to service definition property for feature service.

async

Description: Support options for asynchronous processing. The default format is false.

Values: true | false

Example usage

Example 1: Enable editor tracking and ownership access control in a feature service

Example 2: Update feature service capability

Example 3: Enable feature service sync

Example 4: Update feature service properties

Example 1

Enable editor tracking and ownership access control in a feature service:

http://services.myserver.com/OrgID/ArcGIS/rest/admin/services/example1/FeatureServer/updateDefinition

Example input (POST body)

"editorTrackingInfo" : {
    "enableEditorTracking" : true, 
    "enableOwnershipAccessControl" : true, 
    "allowOthersToUpdate" : true, 
    "allowOthersToDelete" : false
  }
}

JSON Response syntax

{
  "success": <true|false>,
  "error": {
    "code": <code>,
    "message": "<description>",
    "details": [
      "<message>"
    ]
  }
}

JSON Response example (when addToDefinition succeeds)

{
  "success" : true
}

JSON Response example (when addToDefinition fails)

{
  "error" : 
  {
    "code" : 400, 
    "message" : "", 
    "details" : [
      "Unable to update feature service definition."
    ]
  }
}

Example 2

Update feature service capability:

http://services.myserver.com/OrgID/ArcGIS/rest/admin/services/example2/FeatureServer/updateDefinition

Example input (POST body)

{"capabilities":"Create, Query"}

JSON Response syntax

{
  "success": <true|false>,
  "error": {
    "code": <code>,
    "message": "<description>",
    "details": [
      "<message>"
    ]
  }
}

JSON Response example (when updateDefinition succeeds)

{
  "success" : true
}

JSON Response example (when updateDefinition fails)

{
  "error" : 
  {
    "code" : 400, 
    "message" : "", 
    "details" : [
      "Unable to update feature service definition."
    ]
  }
}

Example 3

Enable feature service sync:

http://services.myserver.com/OrgID/ArcGIS/rest/admin/services/example3/FeatureServer/updateDefinition

Example input (POST body)

{"syncEnabled": true}

JSON Response syntax

{
  "success": <true|false>,
  "error": {
    "code": <code>,
    "message": "<description>",
    "details": [
      "<message>"
    ]
  }
}

JSON Response example (when updateDefinition succeeds)

{
  "success" : true
}

JSON Response example (when updateDefinition fails)

{
  "error" : 
  {
    "code" : 400, 
    "message" : "", 
    "details" : [
      "Unable to update feature service definition."
    ]
  }
}

Example 4

Update feature service properties:

http://services.myserver.com/OrgID/ArcGIS/rest/admin/services/example4/FeatureServer/updateDefinition

Example input (POST body)

{ 
  "name" : "SanFrancisco2", 
  "hasStaticData" : false, 
  "allowGeometryUpdates" : "true",
  "maxRecordCount" : 2000, 
  "serviceDescription" : "SanFrancisco2",  
  "description" : "",     
  "copyrightText" : "",
  "units" : "",
  "xssPreventionInfo" : {
    "xssPreventionEnabled" : true, 
    "xssPreventionRule" : "InputOnly", 
    "xssInputRule" : "rejectInvalid"
  },   
  "initialExtent" : {
    "xmin": -122.514435102,
    "ymin": 5.6843418860808E-14,
    "xmax": 138.625776397,
    "ymax": 67.1577965990001
  }
}

JSON Response syntax

{
  "success": <true|false>,
  "error": {
    "code": <code>,
    "message": "<description>",
    "details": [
      "<message>"
    ]
  }
}

JSON Response example (when updateDefinition succeeds)

{
  "success" : true
}

JSON Response example (when updateDefinition fails)

{
  "error" : 
  {
    "code" : 400, 
    "message" : "", 
    "details" : [
      "Unable to update feature service definition."
    ]
  }
}

9/13/2017