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