專案

一般

設定檔

動作

附件

如需透過 API 附加檔案,請參閱一般主題中的 附加檔案

/attachments/:id.:format

GET

傳回指定 ID 附件的描述。
實際上可以從回應中 content_url 屬性提供的 URL 下載檔案。

範例:

GET /attachments/13.xml

回應:

<attachment>
  <id>6243</id>
  <filename>test.txt</filename>
  <filesize>124</filesize>
  <content_type>text/plain</content_type>
  <description>This is an attachment</description>
  <content_url>https://127.0.0.1:3000/attachments/download/6243/test.txt</content_url>
  <author name="Jean-Philippe Lang" id="1"/>
  <created_on>2011-07-18T22:58:40+02:00</created_on>
</attachment>

注意:透過 API 取得議題時,也可以使用 GET /issues/:id.:format?include=attachments 在單一請求中擷取其附件。

PATCH

更新附件。

(尚未記錄。如需詳細資訊,請參閱 #12181。)

DELETE

刪除附件。

範例:

DELETE /attachments/6243.json

Lutz Horn4 年多前 更新 · 5 個版本