Rest Versions » History » Version 9

Go MAEDA, 2019-04-28 16:44
Added wiki_page_title that is going to be supported in Redmine 4.1.0

1 1 Jean-Philippe Lang
h1. Versions
2 1 Jean-Philippe Lang
3 1 Jean-Philippe Lang
{{>toc}}
4 1 Jean-Philippe Lang
5 1 Jean-Philippe Lang
h2. /projects/:project_id/versions.: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 versions available for the project of given id or identifier (:project_id). The response may include shared versions from other projects.
10 1 Jean-Philippe Lang
11 1 Jean-Philippe Lang
+Examples+:
12 1 Jean-Philippe Lang
13 1 Jean-Philippe Lang
<pre>
14 5 Stefan Wichmann
GET /projects/foo/versions.xml
15 5 Stefan Wichmann
GET /projects/1/versions.xml
16 1 Jean-Philippe Lang
</pre>
17 1 Jean-Philippe Lang
18 1 Jean-Philippe Lang
+Response+:
19 1 Jean-Philippe Lang
20 7 Toshi MARUYAMA
<pre><code class="xml">
21 1 Jean-Philippe Lang
<?xml version="1.0" encoding="UTF-8"?>
22 1 Jean-Philippe Lang
<versions type="array" total_count="34">
23 1 Jean-Philippe Lang
  <version>
24 1 Jean-Philippe Lang
    <id>1</id>
25 1 Jean-Philippe Lang
    <project name="Redmine" id="1"/>
26 1 Jean-Philippe Lang
    <name>0.7</name>
27 1 Jean-Philippe Lang
    <description/>
28 1 Jean-Philippe Lang
    <status>closed</status>
29 1 Jean-Philippe Lang
    <due_date>2008-04-28</due_date>
30 6 Go MAEDA
    <sharing>none</sharing>
31 1 Jean-Philippe Lang
    <created_on>2008-03-09T12:52:06+01:00</created_on>
32 1 Jean-Philippe Lang
    <updated_on>2009-11-15T12:22:12+01:00</updated_on>
33 9 Go MAEDA
    <wiki_page_title>FooBarWikiPage</version_wiki_page_title>
34 1 Jean-Philippe Lang
  </version>
35 1 Jean-Philippe Lang
  <version>
36 1 Jean-Philippe Lang
    <id>2</id>
37 1 Jean-Philippe Lang
    <project name="Redmine" id="1"/>
38 1 Jean-Philippe Lang
    <name>0.8</name>
39 1 Jean-Philippe Lang
    <description/>
40 1 Jean-Philippe Lang
    <status>closed</status>
41 1 Jean-Philippe Lang
    <due_date>2008-12-30</due_date>
42 6 Go MAEDA
    <sharing>none</sharing>
43 9 Go MAEDA
    <wiki_page_title>FooBarWikiPage</version_wiki_page_title>
44 1 Jean-Philippe Lang
    <created_on>2008-03-09T12:52:12+01:00</created_on>
45 1 Jean-Philippe Lang
    <updated_on>2009-11-15T12:22:12+01:00</updated_on>
46 1 Jean-Philippe Lang
  </version>
47 1 Jean-Philippe Lang
</versions>
48 7 Toshi MARUYAMA
</code></pre>
49 1 Jean-Philippe Lang
50 1 Jean-Philippe Lang
h3. POST
51 1 Jean-Philippe Lang
52 1 Jean-Philippe Lang
Creates a version for the project of given id or identifier (:project_id).
53 1 Jean-Philippe Lang
54 1 Jean-Philippe Lang
+Parameters+:
55 1 Jean-Philippe Lang
56 1 Jean-Philippe Lang
* @version@ (required): a hash of the version attributes, including:
57 1 Jean-Philippe Lang
58 1 Jean-Philippe Lang
  * @name@ (required)
59 2 Jean-Philippe Lang
  * @status@: the status of the version in: @open (default), locked, closed@
60 2 Jean-Philippe Lang
  * @sharing@: the version sharing in: @none (default), descendants, hierarchy, tree, system@
61 1 Jean-Philippe Lang
  * @due_date@
62 1 Jean-Philippe Lang
  * @description@
63 9 Go MAEDA
  * @wiki_page_title@
64 1 Jean-Philippe Lang
65 1 Jean-Philippe Lang
+Response+:
66 1 Jean-Philippe Lang
67 1 Jean-Philippe Lang
  * @201 Created@: version was created
68 1 Jean-Philippe Lang
  * @422 Unprocessable Entity@: version was not created due to validation failures (response body contains the error messages)
69 1 Jean-Philippe Lang
70 3 Jean-Philippe Lang
h2. /versions/:id.:format
71 1 Jean-Philippe Lang
72 1 Jean-Philippe Lang
h3. GET
73 1 Jean-Philippe Lang
74 1 Jean-Philippe Lang
Returns the version of given id.
75 1 Jean-Philippe Lang
76 1 Jean-Philippe Lang
+Example+:
77 1 Jean-Philippe Lang
78 1 Jean-Philippe Lang
<pre>
79 4 Jean-Philippe Lang
GET /versions/2.xml
80 1 Jean-Philippe Lang
</pre>
81 1 Jean-Philippe Lang
82 1 Jean-Philippe Lang
+Response+:
83 1 Jean-Philippe Lang
84 8 Toshi MARUYAMA
<pre><code class="xml">
85 1 Jean-Philippe Lang
<?xml version="1.0" encoding="UTF-8"?>
86 1 Jean-Philippe Lang
<version>
87 1 Jean-Philippe Lang
  <id>2</id>
88 1 Jean-Philippe Lang
  <project name="Redmine" id="1"/>
89 1 Jean-Philippe Lang
  <name>0.8</name>
90 1 Jean-Philippe Lang
  <description/>
91 1 Jean-Philippe Lang
  <status>closed</status>
92 1 Jean-Philippe Lang
  <due_date>2008-12-30</due_date>
93 1 Jean-Philippe Lang
  <created_on>2008-03-09T12:52:12+01:00</created_on>
94 1 Jean-Philippe Lang
  <updated_on>2009-11-15T12:22:12+01:00</updated_on>
95 1 Jean-Philippe Lang
</version>
96 8 Toshi MARUYAMA
</code></pre>
97 1 Jean-Philippe Lang
98 1 Jean-Philippe Lang
h3. PUT
99 1 Jean-Philippe Lang
100 1 Jean-Philippe Lang
Updates the version of given id
101 1 Jean-Philippe Lang
102 1 Jean-Philippe Lang
+Parameters+:
103 1 Jean-Philippe Lang
104 1 Jean-Philippe Lang
Same as version creation
105 1 Jean-Philippe Lang
106 1 Jean-Philippe Lang
+Response+:
107 1 Jean-Philippe Lang
108 1 Jean-Philippe Lang
  * @200 OK@: version was updated
109 1 Jean-Philippe Lang
  * @422 Unprocessable Entity@: version was not updated due to validation failures (response body contains the error messages)
110 1 Jean-Philippe Lang
111 1 Jean-Philippe Lang
h3. DELETE
112 1 Jean-Philippe Lang
113 1 Jean-Philippe Lang
Deletes the version of given id.
114 1 Jean-Philippe Lang
115 1 Jean-Philippe Lang
+Response+:
116 1 Jean-Philippe Lang
117 1 Jean-Philippe Lang
  * @200 OK@: version was deleted
118 1 Jean-Philippe Lang
  * @422 Unprocessable Entity@: version was not deleted (response body contains the error messages)