Rest Attachments » History » Version 1

Jean-Philippe Lang, 2011-07-18 23:02

1 1 Jean-Philippe Lang
h1. Attachments
2 1 Jean-Philippe Lang
3 1 Jean-Philippe Lang
h2. /attachments/:id.:format
4 1 Jean-Philippe Lang
5 1 Jean-Philippe Lang
h3. GET
6 1 Jean-Philippe Lang
7 1 Jean-Philippe Lang
Returns the description of the attachment of given id. 
8 1 Jean-Philippe Lang
The file can actually be downloaded at the URL given by the @content_url@ attribute in the response.
9 1 Jean-Philippe Lang
10 1 Jean-Philippe Lang
+Example+:
11 1 Jean-Philippe Lang
12 1 Jean-Philippe Lang
<pre>
13 1 Jean-Philippe Lang
GET /attachments/13.xml
14 1 Jean-Philippe Lang
</pre>
15 1 Jean-Philippe Lang
16 1 Jean-Philippe Lang
+Response+:
17 1 Jean-Philippe Lang
18 1 Jean-Philippe Lang
<pre>
19 1 Jean-Philippe Lang
<attachment>
20 1 Jean-Philippe Lang
  <id>6243</id>
21 1 Jean-Philippe Lang
  <filename>test.txt</filename>
22 1 Jean-Philippe Lang
  <filesize>124</filesize>
23 1 Jean-Philippe Lang
  <content_type>text/plain</content_type>
24 1 Jean-Philippe Lang
  <description>This is an attachment</description>
25 1 Jean-Philippe Lang
  <content_url>http://localhost:3000/attachments/download/6243/test.txt</content_url>
26 1 Jean-Philippe Lang
  <author name="Jean-Philippe Lang" id="1"/>
27 1 Jean-Philippe Lang
  <created_on>2011-07-18T22:58:40+02:00</created_on>
28 1 Jean-Philippe Lang
</attachment>
29 1 Jean-Philippe Lang
</pre>
30 1 Jean-Philippe Lang
31 1 Jean-Philippe Lang
32 1 Jean-Philippe Lang
Note: when getting an issue through the API, its attachments can also be retrieved in a single request using @GET /issues/:id.:format?include=attachments@.