Rest Projects » History » Version 7
Ian Epperson, 2010-10-21 05:29
1 | 1 | Jean-Philippe Lang | h1. Projects |
---|---|---|---|
2 | |||
3 | h2. Listing projects |
||
4 | |||
5 | GET /projects.xml |
||
6 | |||
7 | Returns all projects |
||
8 | |||
9 | +Response+: |
||
10 | |||
11 | <pre> |
||
12 | <projects type="array"> |
||
13 | 3 | Christoph Witzany | <project> |
14 | <id>1</id> |
||
15 | 1 | Jean-Philippe Lang | <name>Redmine</name> |
16 | <identifier>redmine</identifier> |
||
17 | <description> |
||
18 | Redmine is a flexible project management web application written using Ruby on Rails framework. |
||
19 | </description> |
||
20 | <created_on>Sat Sep 29 12:03:04 +0200 2007</created_on> |
||
21 | <updated_on>Sun Mar 15 12:35:11 +0100 2009</updated_on> |
||
22 | </project> |
||
23 | 3 | Christoph Witzany | <project> |
24 | <id>2</id> |
||
25 | 1 | Jean-Philippe Lang | ... |
26 | </project> |
||
27 | </pre> |
||
28 | |||
29 | h2. Showing a project |
||
30 | |||
31 | GET /projects/[id].xml |
||
32 | |||
33 | Returns the project of given id or identifier. |
||
34 | |||
35 | +Examples+: |
||
36 | |||
37 | <pre> |
||
38 | GET /projects/12.xml |
||
39 | GET /projects/redmine.xml |
||
40 | </pre> |
||
41 | |||
42 | +Response+: |
||
43 | |||
44 | <pre> |
||
45 | <?xml version="1.0" encoding="UTF-8"?> |
||
46 | <project id="1"> |
||
47 | <name>Redmine</name> |
||
48 | <identifier>redmine</identifier> |
||
49 | <description> |
||
50 | Redmine is a flexible project management web application written using Ruby on Rails framework. |
||
51 | </description> |
||
52 | <homepage></homepage> |
||
53 | <created_on>Sat Sep 29 12:03:04 +0200 2007</created_on> |
||
54 | <updated_on>Sun Mar 15 12:35:11 +0100 2009</updated_on> |
||
55 | </project> |
||
56 | </pre> |
||
57 | |||
58 | |||
59 | h2. Creating a project |
||
60 | |||
61 | POST /projects.xml |
||
62 | |||
63 | Creates a the project. |
||
64 | |||
65 | +Parameters+: |
||
66 | |||
67 | * @project@ (required): a hash of the project attributes, including: |
||
68 | |||
69 | * @name@ (required): the project name |
||
70 | * @identifier@ (required): the project identifier |
||
71 | * @description@ |
||
72 | |||
73 | +Response+: |
||
74 | |||
75 | * @201 Created@: project was created |
||
76 | * @422 Unprocessable Entity@: project was not created due to validation failures (response body contains the error messages) |
||
77 | |||
78 | h2. Updating a project |
||
79 | |||
80 | PUT /projects/[id].xml |
||
81 | |||
82 | Updates the project of given id or identifier. |
||
83 | |||
84 | h2. Deleting a project |
||
85 | |||
86 | DELETE /projects/[id].xml |
||
87 | |||
88 | Deletes the project of given id or identifier. |
||
89 | 4 | Ryan Lovelett | |
90 | h2. Authentication |
||
91 | |||
92 | 7 | Ian Epperson | To interact with projects that are not open to the public (ie. not having the projects [[RedmineProjectSettings#General-settings|public setting]] ticked) you _must_ use your API keyor username/password. The API key is a handy way to avoid putting a password in a script. You can find your API key on the My account page ( /my/account ) when logged in, on the right-hand pane of the default layout. The API key may be attached to the GET request as a "key" parameter or it may be passed in as a username with a random password. (Note that at the time of this writing, the "key" parameter will not be able to retrieve a specific project and can only retrieve all projects.) |
93 | 4 | Ryan Lovelett | |
94 | +Examples _(not real keys)_+: |
||
95 | |||
96 | <pre> |
||
97 | GET /projects.xml?key=1a022b4661da64e5dca53ebab0c94ad7 |
||
98 | GET /projects/12.xml?key=1a022b4661da64e5dca53ebab0c94ad7 |
||
99 | GET /projects/redmine.xml&key=1a022b4661da64e5dca53ebab0c94ad7 |
||
100 | </pre> |