Rest Users » History » Version 1
  Jean-Philippe Lang, 2010-12-23 14:51 
  
| 1 | 1 | Jean-Philippe Lang | h1. Users | 
|---|---|---|---|
| 2 | |||
| 3 | h2. Listing users | ||
| 4 | |||
| 5 | GET /users.xml | ||
| 6 | |||
| 7 | Returns users. | ||
| 8 | |||
| 9 | h2. Showing a user | ||
| 10 | |||
| 11 | GET /users/[id].xml | ||
| 12 | |||
| 13 | Returns the user of given id. | ||
| 14 | |||
| 15 | GET /users/current.xml | ||
| 16 | |||
| 17 | Returns the user whose credentials are used to access the API. | ||
| 18 | |||
| 19 | h2. Creating a user | ||
| 20 | |||
| 21 | POST /users.xml | ||
| 22 | |||
| 23 | Creates a user. | ||
| 24 | |||
| 25 | +Parameters+: | ||
| 26 | |||
| 27 | * @user@ (required): a hash of the user attributes, including: | ||
| 28 | |||
| 29 | * @login@ (required): the user login | ||
| 30 | * @password@: the user password | ||
| 31 | * @firstname@ (required) | ||
| 32 | * @lastname@ (required) | ||
| 33 | * @mail@ (required) | ||
| 34 | |||
| 35 | +Response+: | ||
| 36 | |||
| 37 | * @201 Created@: user was created | ||
| 38 | * @422 Unprocessable Entity@: user was not created due to validation failures (response body contains the error messages) | ||
| 39 | |||
| 40 | h2. Updating a user | ||
| 41 | |||
| 42 | PUT /users/[id].xml | ||
| 43 | |||
| 44 | +Parameters+: | ||
| 45 | |||
| 46 | * @user@ (required): a hash of the user attributes | ||
| 47 | |||
| 48 | Updates the user of given id. | ||
| 49 | |||
| 50 | h2. Deleting a user | ||
| 51 | |||
| 52 | Deleting a user is not supported yet. |