Rest Versions » History » Version 5

Stefan Wichmann, 2012-01-08 01:23
typo ...

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 1 Jean-Philippe Lang
<pre>
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 1 Jean-Philippe Lang
    <created_on>2008-03-09T12:52:06+01:00</created_on>
31 1 Jean-Philippe Lang
    <updated_on>2009-11-15T12:22:12+01:00</updated_on>
32 1 Jean-Philippe Lang
  </version>
33 1 Jean-Philippe Lang
  <version>
34 1 Jean-Philippe Lang
    <id>2</id>
35 1 Jean-Philippe Lang
    <project name="Redmine" id="1"/>
36 1 Jean-Philippe Lang
    <name>0.8</name>
37 1 Jean-Philippe Lang
    <description/>
38 1 Jean-Philippe Lang
    <status>closed</status>
39 1 Jean-Philippe Lang
    <due_date>2008-12-30</due_date>
40 1 Jean-Philippe Lang
    <created_on>2008-03-09T12:52:12+01:00</created_on>
41 1 Jean-Philippe Lang
    <updated_on>2009-11-15T12:22:12+01:00</updated_on>
42 1 Jean-Philippe Lang
  </version>
43 1 Jean-Philippe Lang
</versions>
44 1 Jean-Philippe Lang
</pre>
45 1 Jean-Philippe Lang
46 1 Jean-Philippe Lang
h3. POST
47 1 Jean-Philippe Lang
48 1 Jean-Philippe Lang
Creates a version for the project of given id or identifier (:project_id).
49 1 Jean-Philippe Lang
50 1 Jean-Philippe Lang
+Parameters+:
51 1 Jean-Philippe Lang
52 1 Jean-Philippe Lang
* @version@ (required): a hash of the version attributes, including:
53 1 Jean-Philippe Lang
54 1 Jean-Philippe Lang
  * @name@ (required)
55 2 Jean-Philippe Lang
  * @status@: the status of the version in: @open (default), locked, closed@
56 2 Jean-Philippe Lang
  * @sharing@: the version sharing in: @none (default), descendants, hierarchy, tree, system@
57 1 Jean-Philippe Lang
  * @due_date@
58 1 Jean-Philippe Lang
  * @description@
59 1 Jean-Philippe Lang
60 1 Jean-Philippe Lang
+Response+:
61 1 Jean-Philippe Lang
62 1 Jean-Philippe Lang
  * @201 Created@: version was created
63 1 Jean-Philippe Lang
  * @422 Unprocessable Entity@: version was not created due to validation failures (response body contains the error messages)
64 1 Jean-Philippe Lang
65 3 Jean-Philippe Lang
h2. /versions/:id.:format
66 1 Jean-Philippe Lang
67 1 Jean-Philippe Lang
h3. GET
68 1 Jean-Philippe Lang
69 1 Jean-Philippe Lang
Returns the version of given id.
70 1 Jean-Philippe Lang
71 1 Jean-Philippe Lang
+Example+:
72 1 Jean-Philippe Lang
73 1 Jean-Philippe Lang
<pre>
74 4 Jean-Philippe Lang
GET /versions/2.xml
75 1 Jean-Philippe Lang
</pre>
76 1 Jean-Philippe Lang
77 1 Jean-Philippe Lang
+Response+:
78 1 Jean-Philippe Lang
79 1 Jean-Philippe Lang
<pre>
80 1 Jean-Philippe Lang
<?xml version="1.0" encoding="UTF-8"?>
81 1 Jean-Philippe Lang
<version>
82 1 Jean-Philippe Lang
  <id>2</id>
83 1 Jean-Philippe Lang
  <project name="Redmine" id="1"/>
84 1 Jean-Philippe Lang
  <name>0.8</name>
85 1 Jean-Philippe Lang
  <description/>
86 1 Jean-Philippe Lang
  <status>closed</status>
87 1 Jean-Philippe Lang
  <due_date>2008-12-30</due_date>
88 1 Jean-Philippe Lang
  <created_on>2008-03-09T12:52:12+01:00</created_on>
89 1 Jean-Philippe Lang
  <updated_on>2009-11-15T12:22:12+01:00</updated_on>
90 1 Jean-Philippe Lang
</version>
91 1 Jean-Philippe Lang
</pre>
92 1 Jean-Philippe Lang
93 1 Jean-Philippe Lang
h3. PUT
94 1 Jean-Philippe Lang
95 1 Jean-Philippe Lang
Updates the version of given id
96 1 Jean-Philippe Lang
97 1 Jean-Philippe Lang
+Parameters+:
98 1 Jean-Philippe Lang
99 1 Jean-Philippe Lang
Same as version creation
100 1 Jean-Philippe Lang
101 1 Jean-Philippe Lang
+Response+:
102 1 Jean-Philippe Lang
103 1 Jean-Philippe Lang
  * @200 OK@: version was updated
104 1 Jean-Philippe Lang
  * @422 Unprocessable Entity@: version was not updated due to validation failures (response body contains the error messages)
105 1 Jean-Philippe Lang
106 1 Jean-Philippe Lang
h3. DELETE
107 1 Jean-Philippe Lang
108 1 Jean-Philippe Lang
Deletes the version of given id.
109 1 Jean-Philippe Lang
110 1 Jean-Philippe Lang
+Response+:
111 1 Jean-Philippe Lang
112 1 Jean-Philippe Lang
  * @200 OK@: version was deleted
113 1 Jean-Philippe Lang
  * @422 Unprocessable Entity@: version was not deleted (response body contains the error messages)