Project

General

Profile

Rest Attachments » History » Version 2

Jean-Philippe Lang, 2012-04-11 19:30

1 1 Jean-Philippe Lang
h1. Attachments
2
3 2 Jean-Philippe Lang
To attach files though the API, please see [[Rest_api#Attaching-files|Attaching files]] in general topics.
4
5 1 Jean-Philippe Lang
h2. /attachments/:id.:format
6
7
h3. GET
8
9
Returns the description of the attachment of given id. 
10
The file can actually be downloaded at the URL given by the @content_url@ attribute in the response.
11
12
+Example+:
13
14
<pre>
15
GET /attachments/13.xml
16
</pre>
17
18
+Response+:
19
20
<pre>
21
<attachment>
22
  <id>6243</id>
23
  <filename>test.txt</filename>
24
  <filesize>124</filesize>
25
  <content_type>text/plain</content_type>
26
  <description>This is an attachment</description>
27
  <content_url>http://localhost:3000/attachments/download/6243/test.txt</content_url>
28
  <author name="Jean-Philippe Lang" id="1"/>
29
  <created_on>2011-07-18T22:58:40+02:00</created_on>
30
</attachment>
31
</pre>
32
33
34
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@.