Project

General

Profile

Rest Attachments » History » Version 5

Lutz Horn, 2020-01-09 11:24
added documentation for DELETE

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 4 Toshi MARUYAMA
<pre><code class="xml">
21 1 Jean-Philippe Lang
<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 4 Toshi MARUYAMA
</code></pre>
32 1 Jean-Philippe Lang
33
34 3 Go MAEDA
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@.
35
36
h3. PATCH
37
38
Updates attachments.
39
40
(Not documented yet. See #12181 for details)
41 5 Lutz Horn
42
h3. DELETE
43
44
Delete an attachment.
45
46
+Example+:
47
48
<pre>
49
DELETE /attachments/6243.json
50
</pre>