Delete an Attachment
/capture/api/v1.1/documents/{docId}/attachments/{attId}
This operation will delete, from Capture, the attachment specified by the docId and attId parameters.
It is an error if the attachment is not attached to the given document.
Note: The OAuth token used in this request must represent an account that has been granted explict access to the step in which this document presently resides. It makes no difference if the account represents a Capture Administator or a Capture User.
Request
- application/json
-
attId: string
The unique identifier of the attachment in Capture.
-
docId: string
The unique identifier of the document in Capture.
-
X-Requested-With: string
A header used to prevent Cross-Site Request Forgery (CSRF) attacks. The only supported value is XMLHttpRequest.
This represents the attachment to be deleted. It can be the entire attachment object, but the only attribute that is necessary is
the stateToken
. It is necessary to verify the delete operation can proceed.
The value of the stateToken
needs to be the value from the attachment to delete, its believed current state. If the stateToken
value does not match the attachment's current stateToken
value, the delete operation will result in an error.
object
-
stateToken:
string
A generated string value that represents a particular state of the attachment.
In general, it is used to allow modifications of the attachment to proceed. It is essentially saying ... delete this attachment if its current
stateToken
matches this value. If the values do not match, the modification is not permitted and the operation results in an error.
Response
- application/json
204 Response
No Content
400 Response
Bad Request
The request could not be processed because it contains missing or invalid information, such as a validation error on an input field or a missing required value. The response will be an Error Detail object.
403 Response
Forbidden
The request was valid and was understood, but the server is refusing action. This may be due to the account not having the necessary permissions for a resource, or attempting a prohibited action (e.g. creating a duplicate item where only one is allowed). The response will be an Error Detail object.
404 Response
Not Found
The request includes a resource URI that does not exist. The response will be an Error Detail object.
409 Response
Conflict
This response indicates the request conflicts with current state of the target resource. The response will be an Error Detail object.
Generally, an error response of 412 (Precondition Failed) will be returned. But a Conflict can occur when there are simultaneous edits on a resource.
412 Response
Precondition Failed
The server does not meet one of the preconditions of the request. The response will be an Error Detail object.
This error response is used specifically when the stateToken
used in the request body does not
match the current stateToken
of the resource.
500 Response
Internal Server Error
The server encountered an unexpected condition that prevented it from fulfilling the request. The response will be an Error Detail object.
Examples
Example 1:
The following example shows how to delete an attachment.
curl -X DELETE -H 'Accept: application/json' 'https://host:port/content/capture/api/v1/documents/dcf65d45-4f53-4f82-998c-5e189de1b6a1/attachments/b22046ce-2c30-49b3-b734-25f62dea5403'
This deletes the attachment with the ID of 'b22046ce-2c30-49b3-b734-25f62dea5403' for the document with the ID 'dcf65d45-4f53-4f82-998c-5e189de1b6a1.
Request Body
{ "stateToken": "07d5b2e35b64a1d89bf18c4809f132d8" }