Project

General

Profile

Rest Versions » History » Version 6

Go MAEDA, 2017-07-25 04:33
Added <sharing> elements in the response of GET

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