Project

General

Profile

Rest Projects » History » Revision 8

Revision 7 (Ian Epperson, 2010-10-21 05:29) → Revision 8/40 (Jean-Philippe Lang, 2010-12-11 14:33)

h1. Projects 

 h2. Listing projects 

   GET /projects.xml 

 Returns all projects 

 +Response+: 

 <pre> 
 <projects type="array"> 
   <project> 
     <id>1</id> 
     <name>Redmine</name> 
     <identifier>redmine</identifier> 
     <description> 
       Redmine is a flexible project management web application written using Ruby on Rails framework. 
     </description> 
     <created_on>Sat Sep 29 12:03:04 +0200 2007</created_on> 
     <updated_on>Sun Mar 15 12:35:11 +0100 2009</updated_on> 
   </project> 
   <project> 
     <id>2</id> 
     ... 
   </project> 
 </pre> 

 h2. Showing a project 

   GET /projects/[id].xml 

 Returns the project of given id or identifier. 

 +Examples+: 

 <pre> 
 GET /projects/12.xml 
 GET /projects/redmine.xml 
 </pre> 

 +Response+: 

 <pre> 
 <?xml version="1.0" encoding="UTF-8"?> 
 <project id="1"> 
   <name>Redmine</name> 
   <identifier>redmine</identifier> 
   <description> 
     Redmine is a flexible project management web application written using Ruby on Rails framework. 
   </description> 
   <homepage></homepage> 
   <created_on>Sat Sep 29 12:03:04 +0200 2007</created_on> 
   <updated_on>Sun Mar 15 12:35:11 +0100 2009</updated_on> 
 </project> 
 </pre> 


 h2. Creating a project 

   POST /projects.xml 

 Creates a the project. 

 +Parameters+: 

 * @project@ (required): a hash of the project attributes, including: 

   * @name@ (required): the project name 
   * @identifier@ (required): the project identifier 
   * @description@ 

 +Response+: 

   * @201 Created@: project was created 
   * @422 Unprocessable Entity@: project was not created due to validation failures (response body contains the error messages) 

 h2. Updating a project 

   PUT /projects/[id].xml 

 Updates the project of given id or identifier. 

 h2. Deleting a project 

   DELETE /projects/[id].xml 

 Deletes the project of given id or identifier. 

 h2. Authentication 

 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.) 

 +Examples _(not real keys)_+: 

 <pre> 
 GET /projects.xml?key=1a022b4661da64e5dca53ebab0c94ad7 
 GET /projects/12.xml?key=1a022b4661da64e5dca53ebab0c94ad7 
 GET /projects/redmine.xml&key=1a022b4661da64e5dca53ebab0c94ad7 
 </pre>