- 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 supports property is set as true and the service has the Shared capability enabled.
Request parameters
| Parameter | Details |
|---|---|
(Required) | An array of Syntax Example |
| The response format. The default format is Values: |
Example usage
The following is a sample POST request for the delete operation that demonstrates deleting two templates:
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=pjsonJSON Response syntax
[
{
<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:
{
"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.
{
"error": {
"code": 400,
"extendedCode": -2147467259,
"message": "Unable to complete operation.",
"details": [
"Failed to delete template: '{DA8E952E-1CF8-4202-826A-5C2422502732}'. Template is being used."
]
}
}