| FRAMES | NO FRAMES | Description | Parameters | Examples | Response |
| URL | http://<featureservicefeature-url>/deleteAttachments (POST only) |
Parent Resource | Feature |
|---|
This operation deletes attachments associated with a feature (POST only). The delete attachments operation is performed on a feature service feature resource.
This operation is available only if the layer has advertised that it has attachments.
A layer has attachments if its hasAttachments property is true.
objectId of the result is the ID of the deleted attachment.
You can provide arguments to the delete attachments operation as query parameters defined in the parameters table below.
| Parameter | Details |
|---|---|
| f | Description: The
response format. The default response format is html. Values: html | json |
| attachmentIds |
Description:
The IDs of the attachments to be deleted.
Syntax: attachmentIds=<attachmentId1>, <attachmentId2>
Example: attachmentIds=58, 4
|
Example 1: In this sample URL the delete attachments operation is performed on feature id 818654 belonging to layer 0 of the 311Incidents FeatureService
http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/FeatureServer/0/818654/deleteAttachments
The input parameter attachmentIds to this operation are the list of Ids of attachments belonging to a feature resource to be deleted
4,58
{
"deleteAttachmentResults": [
{
"objectId": <attachmentId1>,
"globalId": "<globalId1>",
"success": <true | false>,
"error" : { //only if success is false
"code" : <code1>,
"description" : "<description1>",
}
},
{
"objectId": <attachmentId2>,
"globalId": "<globalId2>",
"success": <true | false>,
"error" : {
"code" : <code2>,
"description" : "<description2>",
}
}
]
}
{
"deleteAttachmentResults": [
{
"objectId": 58,
"globalId": null,
"success": true
},
{
"objectId": 4,
"globalId": null,
"success": false,
"error": {
"code": 50,
"description": "Attachment not found"
}
}
]
}