Community articleRetrieving a file attachment
Added by IBM contributorIBM on March 25, 2014
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

Retrieve an Atom document representation of a file attachment from your library.



Retrieve an Atom document representation of a file attachment from your library.

This method returns an Atom document containing the file attachment. If you want to retrieve the file itself, see Retrieving a file.

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

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

You can use one or more of these headers with the GET request.

You can use this input parameter with the GET request.

Input

None.

Output

An Atom entry document containing the Atom document for the file attachment.

Input
Method URI Description
GET /files/basic/api/myuserlibrary/document/{document-id}/attachment/{attachment-id}/entry Returns an Atom document containing the file attachment from your library. This request requires authentication.
Use this URI to retrieve the Atom document if you plan to update the attachment and return it using a PUT request.
Name Type Optional Description
document-id
string No {document-id} is the value of the <td:uuid> or <td:label> element in the Atom entry document of the file with the attachment.
attachment-id
string Yes {attachment-id} is the value of the <td:uuid> or <td:label> elements in the attachment's Atom entry document.
Name Type Optional Description
identifier
string Yes Indicates how the document is identified in the {document-id} variable segment of the web address. By default, the lookup operation is performed with the expectation that the URL contains the value from the <td:uuid> element of the document Atom entry, so the value uuid is used. Specify label if the URL instead contains the value from the <td:label> element of a document Atom entry.
Name Type Optional Description
If-Modified-Since
string Yes Used to validate the local cache of the feed and entry documents retrieved previously. If the feed or entry has not been modified since the specified date, HTTP response code 304 (Not Modified) is returned
If-None-Match
string Yes Contains an ETag response header sent by the server in a previous request to the same URL. If the ETag is still valid for the specified resource, HTTP response code 304 (Not Modified) is returned.
Output
Content Type: application/atom+xml
Code Description
200
OK. Indicates that the file entry was successfully found and returned. If an error occurs, this header contains one of the error codes.
304
Not Modified.
401
Unauthorized.
403
Forbidden.
404
Not Found.