Project

General

Profile

Rest Projects » History » Version 21

yuya ito, 2015-05-30 23:21

1 1 Jean-Philippe Lang
h1. Projects
2
3 21 yuya ito
{{>toc}}
4
5 1 Jean-Philippe Lang
h2. Listing projects
6
7
  GET /projects.xml
8
9 18 Jaroslav Balaz
Returns all projects (all public projects and private projects where user have access to)
10 1 Jean-Philippe Lang
11 17 Jean-Baptiste Barth
+Parameters+:
12
13
* @include@: fetch associated data (optional). Possible values: trackers, issue_categories, enabled_modules (since 2.6.0). Values should be separated by a comma ",".
14
15 1 Jean-Philippe Lang
+Response+:
16
17
<pre>
18
<projects type="array">
19 3 Christoph Witzany
  <project>
20
    <id>1</id>
21 13 Terence Mill
    <name>Redmine</name>
22
    <identifier>redmine</identifier>
23 1 Jean-Philippe Lang
    <description>
24 13 Terence Mill
      Redmine is a flexible project management web application written using Ruby on Rails framework.
25 1 Jean-Philippe Lang
    </description>
26
    <created_on>Sat Sep 29 12:03:04 +0200 2007</created_on>
27
    <updated_on>Sun Mar 15 12:35:11 +0100 2009</updated_on>
28 14 Jean-Baptiste Barth
    <is_public>true</is_public>
29 1 Jean-Philippe Lang
  </project>
30 3 Christoph Witzany
  <project>
31
    <id>2</id>
32 1 Jean-Philippe Lang
    ...
33
  </project>
34
</pre>
35
36 14 Jean-Baptiste Barth
+Notes+:
37
* @is_public@ is exposed since 2.6.0
38
39 1 Jean-Philippe Lang
h2. Showing a project
40
41
  GET /projects/[id].xml
42
43
Returns the project of given id or identifier.
44
45 9 Jean-Philippe Lang
+Parameters+:
46
47 16 Jean-Baptiste Barth
* @include@: fetch associated data (optional). Possible values: trackers, issue_categories, enabled_modules (since 2.6.0). Values should be separated by a comma ",".
48 9 Jean-Philippe Lang
49 1 Jean-Philippe Lang
+Examples+:
50
51
<pre>
52
GET /projects/12.xml
53 10 Jean-Philippe Lang
GET /projects/12.xml?include=trackers
54 1 Jean-Philippe Lang
GET /projects/12.xml?include=trackers,issue_categories
55 15 Jean-Baptiste Barth
GET /projects/12.xml?include=enabled_modules
56 13 Terence Mill
GET /projects/redmine.xml
57 1 Jean-Philippe Lang
</pre>
58
59
+Response+:
60
61
<pre>
62
<?xml version="1.0" encoding="UTF-8"?>
63
<project id="1">
64 13 Terence Mill
  <name>Redmine</name>
65
  <identifier>redmine</identifier>
66 1 Jean-Philippe Lang
  <description>
67 13 Terence Mill
    Redmine is a flexible project management web application written using Ruby on Rails framework.
68 1 Jean-Philippe Lang
  </description>
69
  <homepage></homepage>
70
  <created_on>Sat Sep 29 12:03:04 +0200 2007</created_on>
71
  <updated_on>Sun Mar 15 12:35:11 +0100 2009</updated_on>
72 14 Jean-Baptiste Barth
  <is_public>true</is_public>
73 1 Jean-Philippe Lang
</project>
74
</pre>
75
76 14 Jean-Baptiste Barth
+Notes+:
77
* @is_public@ is exposed since 2.6.0
78 1 Jean-Philippe Lang
79
h2. Creating a project
80
81
  POST /projects.xml
82
83
Creates a the project.
84
85
+Parameters+:
86
87
* @project@ (required): a hash of the project attributes, including:
88
89
  * @name@ (required): the project name
90
  * @identifier@ (required): the project identifier
91
  * @description@
92 20 Lucile Quirion
  * @homepage@
93
  * @is_public@: true or false
94
  * @parent_id@: the parent project number
95
  * @inherit_members@: true or false
96
  * @tracker_ids@: (repeatable element) the tracker id: 1 for Bug, etc.
97
  * @enabled_module_names@: (repeatable element) the module name: boards, calendar, documents, files, gantt, issue_tracking, news, repository, time_tracking, wiki.
98
99
<pre>
100
POST /projects.xml
101
<name>test project</name>
102
<identifier>test</identifier>
103
<enabled_module_names>time_tracking</enabled_module_names>
104
<enabled_module_names>issue_tracking</enabled_module_names>
105
</pre>
106 1 Jean-Philippe Lang
107
+Response+:
108
109
  * @201 Created@: project was created
110
  * @422 Unprocessable Entity@: project was not created due to validation failures (response body contains the error messages)
111
112
h2. Updating a project
113
114
  PUT /projects/[id].xml
115
116
Updates the project of given id or identifier.
117
118
h2. Deleting a project
119
120
  DELETE /projects/[id].xml
121
122
Deletes the project of given id or identifier.
123 11 Wim Bertels
124
h2. Limitations:
125
126 13 Terence Mill
A POST request on Redmine 1.0.1-2 (debian stable) does not work using the API key, but does work with a login/passw authentication
127
http://www.redmine.org/issues/12104