diff options
Diffstat (limited to 'doc/api/users.md')
-rw-r--r-- | doc/api/users.md | 59 |
1 files changed, 52 insertions, 7 deletions
diff --git a/doc/api/users.md b/doc/api/users.md index b38c335490a..28b6c7bd491 100644 --- a/doc/api/users.md +++ b/doc/api/users.md @@ -271,8 +271,8 @@ Parameters: - `can_create_group` (optional) - User can create groups - true or false - `external` (optional) - Flags the user as external - true or false(default) -Note, at the moment this method does only return a 404 error, -even in cases where a 409 (Conflict) would be more appropriate, +Note, at the moment this method does only return a `404` error, +even in cases where a `409` (Conflict) would be more appropriate, e.g. when renaming the email address to some existing one. ## User deletion @@ -291,7 +291,9 @@ Parameters: - `id` (required) - The ID of the user -## Current user +## User + +### For normal users Gets currently authenticated user. @@ -335,6 +337,53 @@ GET /user } ``` +### For admins + +Parameters: + +- `sudo` (required) - the ID of a user + +``` +GET /user +``` + +```json +{ + "id": 1, + "username": "john_smith", + "email": "john@example.com", + "name": "John Smith", + "state": "active", + "avatar_url": "http://localhost:3000/uploads/user/avatar/1/index.jpg", + "web_url": "http://localhost:3000/john_smith", + "created_at": "2012-05-23T08:00:58Z", + "is_admin": false, + "bio": null, + "location": null, + "skype": "", + "linkedin": "", + "twitter": "", + "website_url": "", + "organization": "", + "last_sign_in_at": "2012-06-01T11:41:01Z", + "confirmed_at": "2012-05-23T09:05:22Z", + "theme_id": 1, + "color_scheme_id": 2, + "projects_limit": 100, + "current_sign_in_at": "2012-06-02T06:36:55Z", + "identities": [ + {"provider": "github", "extern_uid": "2435223452345"}, + {"provider": "bitbucket", "extern_uid": "john_smith"}, + {"provider": "google_oauth2", "extern_uid": "8776128412476123468721346"} + ], + "can_create_group": true, + "can_create_project": true, + "two_factor_enabled": true, + "external": false, + "private_token": "dd34asd13as" +} +``` + ## List SSH keys Get a list of currently authenticated user's SSH keys. @@ -449,8 +498,6 @@ Parameters: - `title` (required) - new SSH Key's title - `key` (required) - new SSH key -Will return created key with status `201 Created` on success, or `404 Not found` on fail. - ## Delete SSH key for current user Deletes key owned by currently authenticated user. @@ -581,8 +628,6 @@ Parameters: - `id` (required) - id of specified user - `email` (required) - email address -Will return created email with status `201 Created` on success, or `404 Not found` on fail. - ## Delete email for current user Deletes email owned by currently authenticated user. |