Community articleDeleting a file and its metadata
Added by IBM contributorIBM on November 9, 2015
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

Delete a file and the Atom document representation of its associated metadata from your collection.
Only the owner of a collection can delete a file from the collection.

Authentication

This method requires authentication. In order to delete a document, the currently authenticated user must be owner of the user library containing the document or an administrator.

See Authenticating requests for information about how to authenticate the request.

Note: {document-id} is the value of the <td:uuid> or <td:label> elements in the file's Atom entry document.

You can use this input header in a POST request instead of using the DELETE request.

Input

None.

Output

None.

Input
Method URI Description
DELETE /files/basic/api/myuserlibrary/document/{document-id}/entry You can determine the URI in either of the following ways:
Value of the href attribute of the <link rel="edit"> element in the file's Document Atom entries.
Construct the URI using the following syntax: /basic/api/myuserlibrary/document/{document-id}/entry
Only the owner of a collection can delete a file from the collection.
DELETE /files/{auth}/api/document/{document-id}/entry Delete the file specified by its unique id.
DELETE /files/{auth}/api/userlibrary/{user-id}/document/{document-id}/entry Delete the specified document in the user's library.
DELETE /files/{auth}/api/document/{document-id}/entry Delete the file specified by its unique id.
Name Type Optional Description
document-id
string No {document-id} is the value of the <td:uuid> or <td:label> elements in the file's Atom entry document.
Name Type Optional Description
purge
enumerated Yes If true, the resource will be permanently deleted from the repository.
Default value is false.
Authorized values:
  • true
  • false
deleteResponses
enumerated Yes If true, all child responses will be deleted.
Authorized values:
  • true
  • false
Name Type Optional Description
X-Method-Override
string Yes Tunnels a DELETE request over HTTP POST
X-Update-Nonce
string Yes String. Represents a unique data string generated by the server upon request that you can provide to secure the request. See Getting a nonce key for information about how to request the data string.
Output
Code Description
204
Indicates that the file metadata was successfully deleted.
401
Unauthorized.
403
Forbidden.
404
Not Found.
References
Examples
DELETE /dm/atom/library/6184350042fa52689d98fd6fdda5b8d8/document/338b740042fa61c89da3fd6fdda5b8d8/entry HTTP/1.1

Response returned by the server
200 OK
DELETE /files/basic/api/library/5d06ab0044ed8129bd5ebd4caeec5df1/document/5d06ab0044ed8129bd5ebd4caeec6789/entry HTTP/1.1
Host: example.com:9080
User-Agent: Thingio/1.0

Response returned by the server
HTTP/1.1 204 No Content
Date: Tue, 02 Feb 2010 07:00:48 GMT
Server: IBM_HTTP_Server
Cache-Control: private,must-revalidate,max-age=0
X-LConn-Auth: true
Content-Length: 0
Keep-Alive: timeout=10, max=99
Connection: Keep-Alive
Content-Type: text/plain
Content-Language: en-US