Rest Attachments » History » Version 5
Lutz Horn, 2020-01-09 11:24
added documentation for DELETE
1 | 1 | Jean-Philippe Lang | h1. Attachments |
---|---|---|---|
2 | 1 | Jean-Philippe Lang | |
3 | 2 | Jean-Philippe Lang | To attach files though the API, please see [[Rest_api#Attaching-files|Attaching files]] in general topics. |
4 | 2 | Jean-Philippe Lang | |
5 | 1 | Jean-Philippe Lang | h2. /attachments/:id.:format |
6 | 1 | Jean-Philippe Lang | |
7 | 1 | Jean-Philippe Lang | h3. GET |
8 | 1 | Jean-Philippe Lang | |
9 | 1 | Jean-Philippe Lang | Returns the description of the attachment of given id. |
10 | 1 | Jean-Philippe Lang | The file can actually be downloaded at the URL given by the @content_url@ attribute in the response. |
11 | 1 | Jean-Philippe Lang | |
12 | 1 | Jean-Philippe Lang | +Example+: |
13 | 1 | Jean-Philippe Lang | |
14 | 1 | Jean-Philippe Lang | <pre> |
15 | 1 | Jean-Philippe Lang | GET /attachments/13.xml |
16 | 1 | Jean-Philippe Lang | </pre> |
17 | 1 | Jean-Philippe Lang | |
18 | 1 | Jean-Philippe Lang | +Response+: |
19 | 1 | Jean-Philippe Lang | |
20 | 4 | Toshi MARUYAMA | <pre><code class="xml"> |
21 | 1 | Jean-Philippe Lang | <attachment> |
22 | 1 | Jean-Philippe Lang | <id>6243</id> |
23 | 1 | Jean-Philippe Lang | <filename>test.txt</filename> |
24 | 1 | Jean-Philippe Lang | <filesize>124</filesize> |
25 | 1 | Jean-Philippe Lang | <content_type>text/plain</content_type> |
26 | 1 | Jean-Philippe Lang | <description>This is an attachment</description> |
27 | 1 | Jean-Philippe Lang | <content_url>http://localhost:3000/attachments/download/6243/test.txt</content_url> |
28 | 1 | Jean-Philippe Lang | <author name="Jean-Philippe Lang" id="1"/> |
29 | 1 | Jean-Philippe Lang | <created_on>2011-07-18T22:58:40+02:00</created_on> |
30 | 1 | Jean-Philippe Lang | </attachment> |
31 | 4 | Toshi MARUYAMA | </code></pre> |
32 | 1 | Jean-Philippe Lang | |
33 | 1 | Jean-Philippe Lang | |
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 | 3 | Go MAEDA | |
36 | 3 | Go MAEDA | h3. PATCH |
37 | 3 | Go MAEDA | |
38 | 3 | Go MAEDA | Updates attachments. |
39 | 3 | Go MAEDA | |
40 | 3 | Go MAEDA | (Not documented yet. See #12181 for details) |
41 | 5 | Lutz Horn | |
42 | 5 | Lutz Horn | h3. DELETE |
43 | 5 | Lutz Horn | |
44 | 5 | Lutz Horn | Delete an attachment. |
45 | 5 | Lutz Horn | |
46 | 5 | Lutz Horn | +Example+: |
47 | 5 | Lutz Horn | |
48 | 5 | Lutz Horn | <pre> |
49 | 5 | Lutz Horn | DELETE /attachments/6243.json |
50 | 5 | Lutz Horn | </pre> |