Project

General

Profile

Rest Attachments » History » Revision 3

Revision 2 (Jean-Philippe Lang, 2012-04-11 19:30) → Revision 3/5 (Go MAEDA, 2017-07-12 16:03)

h1. Attachments 

 To attach files though the API, please see [[Rest_api#Attaching-files|Attaching files]] in general topics. 

 h2. /attachments/:id.:format 

 h3. GET 

 Returns the description of the attachment of given id.  
 The file can actually be downloaded at the URL given by the @content_url@ attribute in the response. 

 +Example+: 

 <pre> 
 GET /attachments/13.xml 
 </pre> 

 +Response+: 

 <pre> 
 <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>http://localhost: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> 
 </pre> 


 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@. 


 h3. PATCH 

 Updates attachments. 

 (Not documented yet. See #12181 for details)