Delete (Feature Service/Shared Templates)

URL:
https://<root>/services/<serviceName>/sharedTemplates/delete
Methods:
POST
Required Capability:
SharedTemplateEditing capability enabled on the service
Version Introduced:
11.4

Description

The delete operation deletes existing shared templates from the back-end data source. Once a template is deleted, it will no longer be available to other services that may reference it. Only template owners, or orgaization administrators, can delete a shared template. Support for this operation is indicated when the service's supportsSharedTemplates property is set as true and the service has the SharedTemplateEditing capability enabled.

Request parameters

ParameterDetails

globalIds

(Required)

An array of globalId values for the shared templates to be deleted.

Syntax

Use dark colors for code blocksCopy
1
globalIds=["<guid1>","<guid2>"]

Example

Use dark colors for code blocksCopy
1
globalIds= ["{FA46F1EB-796C-4FB9-8E7B-B184EC6D43DC}","{2D85EDA5-DBEB-4DD1-AA73-C25DFC8BD4B6}"]

f

The response format. The default format is html.

Values: html | json | pjson

Example usage

The following is a sample POST request for the delete operation that demonstrates deleting two templates:

Use dark colors for code blocksCopy
1
2
3
4
5
6
POST /webadaptor/rest/services/MyService/FeatureServer/sharedTemplates/delete HTTP/1/1
Host: machine.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []

globalIds=["{FA46F1EB-796C-4FB9-8E7B-B184EC6D43DC}","{2D85EDA5-DBEB-4DD1-AA73-C25DFC8BD4B6}"]&f=pjson

JSON Response syntax

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
[
  {
    <result1>
  },
  {
    <result2>
  }
]

JSON Response example

The sample response below demonstrates the response returned when the operation completes successfully. The example below shows that two shared templates were successfully updated:

Use dark colors for code blocksCopy
1
2
3
{
  "success": true
}

The sample response below demonstrates the response returned when the operation fails. The example below demonstrates a response that is returned when the template included in the request is referenced by a group or preset template. In order to delete this template, the group or preset template would need to be updated to remove the reference, or the templates would need to be deleted. If the operaiton fails for any reason, all changes are rolled back.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
{
  "error": {
    "code": 400,
    "extendedCode": -2147467259,
    "message": "Unable to complete operation.",
    "details": [
      "Failed to delete template: '{DA8E952E-1CF8-4202-826A-5C2422502732}'. Template is being used."
    ]
  }
}

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