Project

General

Profile

Rest Versions » History » Revision 8

Revision 7 (Toshi MARUYAMA, 2017-07-25 07:12) → Revision 8/11 (Toshi MARUYAMA, 2017-07-25 07:13)

h1. Versions 

 {{>toc}} 

 h2. /projects/:project_id/versions.:format 

 h3. GET 

 Returns the versions available for the project of given id or identifier (:project_id). The response may include shared versions from other projects. 

 +Examples+: 

 <pre> 
 GET /projects/foo/versions.xml 
 GET /projects/1/versions.xml 
 </pre> 

 +Response+: 

 <pre><code class="xml"> 
 <?xml version="1.0" encoding="UTF-8"?> 
 <versions type="array" total_count="34"> 
   <version> 
     <id>1</id> 
     <project name="Redmine" id="1"/> 
     <name>0.7</name> 
     <description/> 
     <status>closed</status> 
     <due_date>2008-04-28</due_date> 
     <sharing>none</sharing> 
     <created_on>2008-03-09T12:52:06+01:00</created_on> 
     <updated_on>2009-11-15T12:22:12+01:00</updated_on> 
   </version> 
   <version> 
     <id>2</id> 
     <project name="Redmine" id="1"/> 
     <name>0.8</name> 
     <description/> 
     <status>closed</status> 
     <due_date>2008-12-30</due_date> 
     <sharing>none</sharing> 
     <created_on>2008-03-09T12:52:12+01:00</created_on> 
     <updated_on>2009-11-15T12:22:12+01:00</updated_on> 
   </version> 
 </versions> 
 </code></pre> 

 h3. POST 

 Creates a version for the project of given id or identifier (:project_id). 

 +Parameters+: 

 * @version@ (required): a hash of the version attributes, including: 

   * @name@ (required) 
   * @status@: the status of the version in: @open (default), locked, closed@ 
   * @sharing@: the version sharing in: @none (default), descendants, hierarchy, tree, system@ 
   * @due_date@ 
   * @description@ 

 +Response+: 

   * @201 Created@: version was created 
   * @422 Unprocessable Entity@: version was not created due to validation failures (response body contains the error messages) 

 h2. /versions/:id.:format 

 

 h3. GET 

 Returns the version of given id. 

 +Example+: 

 <pre> 
 GET /versions/2.xml 
 </pre> 

 +Response+: 

 <pre><code class="xml"> <pre> 
 <?xml version="1.0" encoding="UTF-8"?> 
 <version> 
   <id>2</id> 
   <project name="Redmine" id="1"/> 
   <name>0.8</name> 
   <description/> 
   <status>closed</status> 
   <due_date>2008-12-30</due_date> 
   <created_on>2008-03-09T12:52:12+01:00</created_on> 
   <updated_on>2009-11-15T12:22:12+01:00</updated_on> 
 </version> 
 </code></pre> 

 </pre> 

 h3. PUT 

 Updates the version of given id 

 +Parameters+: 

 Same as version creation 

 +Response+: 

   * @200 OK@: version was updated 
   * @422 Unprocessable Entity@: version was not updated due to validation failures (response body contains the error messages) 

 h3. DELETE 

 Deletes the version of given id. 

 +Response+: 

   * @200 OK@: version was deleted 
   * @422 Unprocessable Entity@: version was not deleted (response body contains the error messages)