Rest Users » History » Version 2
Bevan Rudge, 2011-07-05 01:11
Adding documentation about include=memberships
| 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 | 2 | Bevan Rudge | GET /users/3.json?include=memberships |
| 20 | |||
| 21 | Returns the details about user ID 3, and additional detail about the user's project roles and memberships. *There are probably other such undocumented features like this*. |
||
| 22 | |||
| 23 | 1 | Jean-Philippe Lang | h2. Creating a user |
| 24 | |||
| 25 | POST /users.xml |
||
| 26 | |||
| 27 | Creates a user. |
||
| 28 | |||
| 29 | +Parameters+: |
||
| 30 | |||
| 31 | * @user@ (required): a hash of the user attributes, including: |
||
| 32 | |||
| 33 | * @login@ (required): the user login |
||
| 34 | * @password@: the user password |
||
| 35 | * @firstname@ (required) |
||
| 36 | * @lastname@ (required) |
||
| 37 | * @mail@ (required) |
||
| 38 | |||
| 39 | +Response+: |
||
| 40 | |||
| 41 | * @201 Created@: user was created |
||
| 42 | * @422 Unprocessable Entity@: user was not created due to validation failures (response body contains the error messages) |
||
| 43 | |||
| 44 | h2. Updating a user |
||
| 45 | |||
| 46 | PUT /users/[id].xml |
||
| 47 | |||
| 48 | +Parameters+: |
||
| 49 | |||
| 50 | * @user@ (required): a hash of the user attributes |
||
| 51 | |||
| 52 | Updates the user of given id. |
||
| 53 | |||
| 54 | h2. Deleting a user |
||
| 55 | |||
| 56 | Deleting a user is not supported yet. |