プロジェクト

全般

プロフィール

Rest Attachments » 履歴 » バージョン 2

Mitsuyoshi Yoshida, 2011/12/12 00:38

1 1 Mitsuyoshi Yoshida
redmine.org の "Rest_Attachements":http://www.redmine.org/projects/redmine/wiki/Rest_Attachements (version 1)の日本語訳です。
2
3
{{>toc}}
4
5 2 Mitsuyoshi Yoshida
h1. REST 添付ファイル
6 1 Mitsuyoshi Yoshida
7
h2. フォーマット /attachments/:id
8
9
h3. GET
10
11
指定した ID の添付ファイルに関する情報を取得します。
12
実際に添付ファイルをダウンロードする場合には、レスポンス中に記述された @content_url@ 要素の URL を使用します。
13
14
15
+例+:
16
17
<pre>
18
GET /attachments/13.xml
19
</pre>
20
21
+レスポンス+:
22
23
<pre><code class="xml">
24
<attachment>
25
  <id>6243</id>
26
  <filename>test.txt</filename>
27
  <filesize>124</filesize>
28
  <content_type>text/plain</content_type>
29
  <description>This is an attachment</description>
30
  <content_url>http://localhost:3000/attachments/download/6243/test.txt</content_url>
31
  <author name="Jean-Philippe Lang" id="1"/>
32
  <created_on>2011-07-18T22:58:40+02:00</created_on>
33
</attachment>
34
</code></pre>
35
36
Note: チケット情報を取得する際に以下のように記述すると、添付ファイル情報とチケット情報を一度に取得できます。
37
38
<pre>
39
GET /issues/:id.xml?include=attachments
40
</pre>