Delete Attachment
This REST call allows you to delete attachments in a field.
URL
api/v1/attachments/attachmentId
Method
DELETE
URL parameters
| Parameter | Type | Required | Description | 
|---|---|---|---|
| attachmentId | String | Yes | The ID of the attachment in the attachment field that you want to delete. | 
Header parameters
| Parameter | Type | Required | Description | 
|---|---|---|---|
| X-User-Id | String | Yes | The ID of the user who wants to trigger the REST action. This ID is returned by the authentication call. | 
| X-Auth-Token | String | Yes | The authentication token that the authentication call returned. | 
Query parameters
| Field | Type | Required | Description | 
|---|---|---|---|
| environmentId | String | Yes | The ID of the environment. | 
| ddId | String | No | The ID of the document definition. Either the __id_ or name of the document definition should be supplied. | 
| ddName | String | No | The name of the document definition. Either the __id_ or name of the document definition should be supplied. | 
| documentId | String | No | The internal ID of the document. Either the __id_ or externalId field should be supplied. | 
| externalId | String | No | The external ID of the source document. Either the __id_ or externalId field should be supplied. | 
| fieldName | String | Yes | The name of the field from which the attachment should be downloaded. | 
| lineName | String | No | If the attachment field is part of a line, enter the name of the line here. | 
| lineId | String | No | The ID of the line from which the attachments should be copied. | 
| lineExternalId | String | No | The external ID of the line from which the attachment should be downloaded. If the lineName field has a value, either the lineId or lineExternalId should be entered. | 
Response
Success
Info: response contains id of attachment that was removed.
{
  "status": "success",
  "message": "Attachment e7332f002e32cef6040ab450 was successfully removed."
}
Fail
In case of any error JSON response will be provided:
{
  "status": "error",
  "error": "Error: picture; This field is required [400]"
}
An example:
curl -X DELETE \
  '/api/v1/attachments/e7332f002e32cef6040ab450?ddName=menuItem&documentId=3DKKq68tvhpu9bk24&fieldName=picture&environmentId=maxedy_pizza' \
  -H 'x-auth-token: 6Erh0CLMMjLO8T_OMWFPbQD_PIwE30CcLdJ1GFBO4gc' \
  -H 'x-user-id: a6gA9rYaGTFKPrT5P'