summaryrefslogtreecommitdiff
path: root/doc/api
diff options
context:
space:
mode:
Diffstat (limited to 'doc/api')
-rw-r--r--doc/api/merge_requests.md26
-rw-r--r--doc/api/repositories.md29
-rw-r--r--doc/api/users.md70
3 files changed, 80 insertions, 45 deletions
diff --git a/doc/api/merge_requests.md b/doc/api/merge_requests.md
index 27c0d644e11..a46472a0812 100644
--- a/doc/api/merge_requests.md
+++ b/doc/api/merge_requests.md
@@ -30,7 +30,7 @@ Parameters:
"author": {
"id": 1,
"username": "admin",
- "email": "admin@local.host",
+ "email": "admin@example.com",
"name": "Administrator",
"state": "active",
"created_at": "2012-04-29T08:46:00Z"
@@ -38,7 +38,7 @@ Parameters:
"assignee": {
"id": 1,
"username": "admin",
- "email": "admin@local.host",
+ "email": "admin@example.com",
"name": "Administrator",
"state": "active",
"created_at": "2012-04-29T08:46:00Z"
@@ -74,7 +74,7 @@ Parameters:
"author": {
"id": 1,
"username": "admin",
- "email": "admin@local.host",
+ "email": "admin@example.com",
"name": "Administrator",
"state": "active",
"created_at": "2012-04-29T08:46:00Z"
@@ -82,7 +82,7 @@ Parameters:
"assignee": {
"id": 1,
"username": "admin",
- "email": "admin@local.host",
+ "email": "admin@example.com",
"name": "Administrator",
"state": "active",
"created_at": "2012-04-29T08:46:00Z"
@@ -120,7 +120,7 @@ Parameters:
"author": {
"id": 1,
"username": "admin",
- "email": "admin@local.host",
+ "email": "admin@example.com",
"name": "Administrator",
"state": "active",
"created_at": "2012-04-29T08:46:00Z"
@@ -128,7 +128,7 @@ Parameters:
"assignee": {
"id": 1,
"username": "admin",
- "email": "admin@local.host",
+ "email": "admin@example.com",
"name": "Administrator",
"state": "active",
"created_at": "2012-04-29T08:46:00Z"
@@ -167,7 +167,7 @@ Parameters:
"author": {
"id": 1,
"username": "admin",
- "email": "admin@local.host",
+ "email": "admin@example.com",
"name": "Administrator",
"state": "active",
"created_at": "2012-04-29T08:46:00Z"
@@ -175,7 +175,7 @@ Parameters:
"assignee": {
"id": 1,
"username": "admin",
- "email": "admin@local.host",
+ "email": "admin@example.com",
"name": "Administrator",
"state": "active",
"created_at": "2012-04-29T08:46:00Z"
@@ -218,7 +218,7 @@ Parameters:
"author": {
"id": 1,
"username": "admin",
- "email": "admin@local.host",
+ "email": "admin@example.com",
"name": "Administrator",
"state": "active",
"created_at": "2012-04-29T08:46:00Z"
@@ -226,7 +226,7 @@ Parameters:
"assignee": {
"id": 1,
"username": "admin",
- "email": "admin@local.host",
+ "email": "admin@example.com",
"name": "Administrator",
"state": "active",
"created_at": "2012-04-29T08:46:00Z"
@@ -253,7 +253,7 @@ Parameters:
"author": {
"id": 1,
"username": "admin",
- "email": "admin@local.host",
+ "email": "admin@example.com",
"name": "Administrator",
"blocked": false,
"created_at": "2012-04-29T08:46:00Z"
@@ -282,7 +282,7 @@ Parameters:
"author": {
"id": 11,
"username": "admin",
- "email": "admin@local.host",
+ "email": "admin@example.com",
"name": "Administrator",
"state": "active",
"created_at": "2014-03-06T08:17:35.000Z"
@@ -293,7 +293,7 @@ Parameters:
"author": {
"id": 11,
"username": "admin",
- "email": "admin@local.host",
+ "email": "admin@example.com",
"name": "Administrator",
"state": "active",
"created_at": "2014-03-06T08:17:35.000Z"
diff --git a/doc/api/repositories.md b/doc/api/repositories.md
index 26ae3e87232..2539e3edbf9 100644
--- a/doc/api/repositories.md
+++ b/doc/api/repositories.md
@@ -220,3 +220,32 @@ Response:
"compare_same_ref": false
}
```
+
+## Contributors
+
+Get repository contributors list
+
+```
+GET /projects/:id/repository/contributors
+```
+
+Parameters:
++ `id` (required) - The ID of a project
+
+Response:
+
+```
+[{
+ "name": "Dmitriy Zaporozhets",
+ "email": "dmitriy.zaporozhets@gmail.com",
+ "commits": 117,
+ "additions": 2097,
+ "deletions": 517
+}, {
+ "name": "Jacob Vosmaer",
+ "email": "contact@jacobvosmaer.nl",
+ "commits": 33,
+ "additions": 338,
+ "deletions": 244
+}]
+```
diff --git a/doc/api/users.md b/doc/api/users.md
index 4ddbf739774..57078353fd0 100644
--- a/doc/api/users.md
+++ b/doc/api/users.md
@@ -6,7 +6,7 @@ Get a list of users.
This function takes pagination parameters `page` and `per_page` to restrict the list of users.
-### For normal users:
+### For normal users
```
GET /users
@@ -31,8 +31,7 @@ GET /users
]
```
-
-### For admins:
+### For admins
```
GET /users
@@ -84,7 +83,7 @@ GET /users
]
```
-You can search for a users by email or username with: `/users?search=John`
+You can search for users by email or username with: `/users?search=John`
Also see `def search query` in `app/models/user.rb`.
@@ -92,7 +91,7 @@ Also see `def search query` in `app/models/user.rb`.
Get a single user.
-#### For user:
+### For user
```
GET /users/:id
@@ -112,8 +111,7 @@ Parameters:
}
```
-
-#### For admin:
+### For admin
```
GET /users/:id
@@ -161,13 +159,13 @@ Parameters:
- `username` (required) - Username
- `name` (required) - Name
- `skype` (optional) - Skype ID
-- `linkedin` (optional) - Linkedin
+- `linkedin` (optional) - LinkedIn
- `twitter` (optional) - Twitter account
-- `website_url` (optional) - Website url
+- `website_url` (optional) - Website URL
- `projects_limit` (optional) - Number of projects user can create
- `extern_uid` (optional) - External UID
- `provider` (optional) - External provider name
-- `bio` (optional) - User's bio
+- `bio` (optional) - User's biography
- `admin` (optional) - User is admin - true or false (default)
- `can_create_group` (optional) - User can create groups - true or false
@@ -181,26 +179,32 @@ PUT /users/:id
Parameters:
-- `email` - Email
-- `username` - Username
-- `name` - Name
-- `password` - Password
-- `skype` - Skype ID
-- `linkedin` - Linkedin
-- `twitter` - Twitter account
-- `website_url` - Website url
-- `projects_limit` - Limit projects each user can create
-- `extern_uid` - External UID
-- `provider` - External provider name
-- `bio` - User's bio
-- `admin` (optional) - User is admin - true or false (default)
-- `can_create_group` (optional) - User can create groups - true or false
-
-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.
+- `email` - Email
+- `username` - Username
+- `name` - Name
+- `password` - Password
+- `skype` - Skype ID
+- `linkedin` - LinkedIn
+- `twitter` - Twitter account
+- `website_url` - Website URL
+- `projects_limit` - Limit projects each user can create
+- `extern_uid` - External UID
+- `provider` - External provider name
+- `bio` - User's biography
+- `admin` (optional) - User is admin - true or false (default)
+- `can_create_group` (optional) - User can create groups - true or false
+
+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
-Deletes a user. Available only for administrators. This is an idempotent function, calling this function for a non-existent user id still returns a status code `200 Ok`. The JSON response differs if the user was actually deleted or not. In the former the user is returned and in the latter not.
+Deletes a user. Available only for administrators.
+This is an idempotent function, calling this function for a non-existent user id
+still returns a status code `200 Ok`.
+The JSON response differs if the user was actually deleted or not.
+In the former the user is returned and in the latter not.
```
DELETE /users/:id
@@ -310,7 +314,7 @@ POST /user/keys
Parameters:
- `title` (required) - new SSH Key's title
-- `key` (required) - new SSH key
+- `key` (required) - new SSH key
## Add SSH key for user
@@ -322,15 +326,17 @@ POST /users/:id/keys
Parameters:
-- `id` (required) - id of specified user
+- `id` (required) - id of specified user
- `title` (required) - new SSH Key's title
-- `key` (required) - new SSH key
+- `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. This is an idempotent function and calling it on a key that is already deleted or not available results in `200 Ok`.
+Deletes key owned by currently authenticated user.
+This is an idempotent function and calling it on a key that is already deleted
+or not available results in `200 Ok`.
```
DELETE /user/keys/:id
@@ -351,6 +357,6 @@ DELETE /users/:uid/keys/:id
Parameters:
- `uid` (required) - id of specified user
-- `id` (required) - SSH key ID
+- `id` (required) - SSH key ID
Will return `200 Ok` on success, or `404 Not found` if either user or key cannot be found.