From b437d305ca92f0f908d2cba4d681a8c8df9a348a Mon Sep 17 00:00:00 2001 From: Ruben Davila Date: Wed, 23 Nov 2016 19:27:22 -0500 Subject: Add default_branch attr to Project API payload in docs. --- doc/api/projects.md | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/api/projects.md') diff --git a/doc/api/projects.md b/doc/api/projects.md index de5d3b07c21..b02a901d884 100644 --- a/doc/api/projects.md +++ b/doc/api/projects.md @@ -592,6 +592,7 @@ Parameters: | `name` | string | yes | The name of the new project | | `path` | string | no | Custom repository name for new project. By default generated based on name | | `namespace_id` | integer | no | Namespace for the new project (defaults to the current user's namespace) | +| `default_branch` | string | no | `master` by default | | `description` | string | no | Short project description | | `issues_enabled` | boolean | no | Enable issues for this project | | `merge_requests_enabled` | boolean | no | Enable merge requests for this project | @@ -657,6 +658,7 @@ Parameters: | `id` | integer/string | yes | The ID or NAMESPACE/PROJECT_NAME of the project | | `name` | string | yes | The name of the project | | `path` | string | no | Custom repository name for the project. By default generated based on name | +| `default_branch` | string | no | `master` by default | | `description` | string | no | Short project description | | `issues_enabled` | boolean | no | Enable issues for this project | | `merge_requests_enabled` | boolean | no | Enable merge requests for this project | -- cgit v1.2.1 From 28f4d7aa28c6ce2765fce7922058c82f7633dae3 Mon Sep 17 00:00:00 2001 From: Robert Schilling Date: Thu, 24 Nov 2016 15:29:22 +0100 Subject: You can only assign default_branch when editing a project or when creating a project for a specified user [ci skip] You can only assign default_branch when editing a project [ci skip] --- doc/api/projects.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/api/projects.md') diff --git a/doc/api/projects.md b/doc/api/projects.md index b02a901d884..bd27a0a6fae 100644 --- a/doc/api/projects.md +++ b/doc/api/projects.md @@ -592,7 +592,6 @@ Parameters: | `name` | string | yes | The name of the new project | | `path` | string | no | Custom repository name for new project. By default generated based on name | | `namespace_id` | integer | no | Namespace for the new project (defaults to the current user's namespace) | -| `default_branch` | string | no | `master` by default | | `description` | string | no | Short project description | | `issues_enabled` | boolean | no | Enable issues for this project | | `merge_requests_enabled` | boolean | no | Enable merge requests for this project | @@ -625,6 +624,7 @@ Parameters: | `user_id` | integer | yes | The user ID of the project owner | | `name` | string | yes | The name of the new project | | `path` | string | no | Custom repository name for new project. By default generated based on name | +| `default_branch` | string | no | `master` by default | | `namespace_id` | integer | no | Namespace for the new project (defaults to the current user's namespace) | | `description` | string | no | Short project description | | `issues_enabled` | boolean | no | Enable issues for this project | -- cgit v1.2.1 From ed61d44e1edfd41c36ec9085aa95f470bb5699fa Mon Sep 17 00:00:00 2001 From: Luis Alonso Chavez Armendariz Date: Thu, 24 Nov 2016 10:28:52 -0700 Subject: Remove unnecessary sentences for status codes in the API documentation --- doc/api/projects.md | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'doc/api/projects.md') diff --git a/doc/api/projects.md b/doc/api/projects.md index 467a880ac13..4993448ff25 100644 --- a/doc/api/projects.md +++ b/doc/api/projects.md @@ -644,7 +644,7 @@ Parameters: ### Edit project -Updates an existing project +Updates an existing project. ``` PUT /projects/:id @@ -674,9 +674,6 @@ Parameters: | `lfs_enabled` | boolean | no | Enable LFS | | `request_access_enabled` | boolean | no | Allow users to request member access | -On success, method returns 200 with the updated project. If parameters are -invalid, 400 is returned. - ### Fork project Forks a project into the user namespace of the authenticated user or the one provided. @@ -694,8 +691,7 @@ Parameters: ### Star a project -Stars a given project. Returns status code `201` and the project on success and -`304` if the project is already starred. +Stars a given project. Returns status code `304` if the project is already starred. ``` POST /projects/:id/star @@ -765,8 +761,7 @@ Example response: ### Unstar a project -Unstars a given project. Returns status code `200` and the project on success -and `304` if the project is not starred. +Unstars a given project. Returns status code `304` if the project is not starred. ``` DELETE /projects/:id/star @@ -837,10 +832,6 @@ Example response: Archives the project if the user is either admin or the project owner of this project. This action is idempotent, thus archiving an already archived project will not change the project. -Status code 201 with the project as body is given when successful, in case the user doesn't -have the proper access rights, code 403 is returned. Status 404 is returned if the project -doesn't exist, or is hidden to the user. - ``` POST /projects/:id/archive ``` @@ -926,10 +917,6 @@ Example response: Unarchives the project if the user is either admin or the project owner of this project. This action is idempotent, thus unarchiving an non-archived project will not change the project. -Status code 201 with the project as body is given when successful, in case the user doesn't -have the proper access rights, code 403 is returned. Status 404 is returned if the project -doesn't exist, or is hidden to the user. - ``` POST /projects/:id/unarchive ``` -- cgit v1.2.1 From 7c607a55ab339293b0e67eeb33439d5407e22aad Mon Sep 17 00:00:00 2001 From: Robert Schilling Date: Wed, 9 Nov 2016 15:51:27 +0100 Subject: Grapify the projects API --- doc/api/projects.md | 1 + 1 file changed, 1 insertion(+) (limited to 'doc/api/projects.md') diff --git a/doc/api/projects.md b/doc/api/projects.md index de57f91bb8e..132be644b59 100644 --- a/doc/api/projects.md +++ b/doc/api/projects.md @@ -626,6 +626,7 @@ Parameters: | `path` | string | no | Custom repository name for new project. By default generated based on name | | `default_branch` | string | no | `master` by default | | `namespace_id` | integer | no | Namespace for the new project (defaults to the current user's namespace) | +| `default_branch` | string | no | `master` by default | | `description` | string | no | Short project description | | `issues_enabled` | boolean | no | Enable issues for this project | | `merge_requests_enabled` | boolean | no | Enable merge requests for this project | -- cgit v1.2.1 From d74801ac6fca7b20e01555ac6339d08b16bba8fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Fri, 2 Dec 2016 14:34:17 +0100 Subject: Document the public Project API and document `GET /projects/:id/users` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- doc/api/projects.md | 48 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 4 deletions(-) (limited to 'doc/api/projects.md') diff --git a/doc/api/projects.md b/doc/api/projects.md index 132be644b59..0bc2a5210aa 100644 --- a/doc/api/projects.md +++ b/doc/api/projects.md @@ -347,7 +347,8 @@ Parameters: ### Get single project Get a specific project, identified by project ID or NAMESPACE/PROJECT_NAME, which is owned by the authenticated user. -If using namespaced projects call make sure that the NAMESPACE/PROJECT_NAME is URL-encoded, eg. `/api/v3/projects/diaspora%2Fdiaspora` (where `/` is represented by `%2F`). +If using namespaced projects call make sure that the NAMESPACE/PROJECT_NAME is URL-encoded, eg. `/api/v3/projects/diaspora%2Fdiaspora` (where `/` is represented by `%2F`). This endpoint can be accessed without authentication if +the project is publicly accessible. ``` GET /projects/:id @@ -436,10 +437,47 @@ Parameters: } ``` +## Get project users + +Get the users list of a project. + + +Parameters: + +| Attribute | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `search` | string | no | Search for specific users | + +``` +GET /projects/:id/users +``` + +```json +[ + { + "id": 1, + "username": "john_smith", + "name": "John Smith", + "state": "active", + "avatar_url": "http://localhost:3000/uploads/user/avatar/1/cd8.jpeg", + "web_url": "http://localhost:3000/john_smith" + }, + { + "id": 2, + "username": "jack_smith", + "name": "Jack Smith", + "state": "blocked", + "avatar_url": "http://gravatar.com/../e32131cd8.jpeg", + "web_url": "http://localhost:3000/jack_smith" + } +] +``` + ### Get project events -Get the events for the specified project. -Sorted from newest to oldest +Get the events for the specified project sorted from newest to oldest. This +endpoint can be accessed without authentication if the project is publicly +accessible. ``` GET /projects/:id/events @@ -1344,7 +1382,9 @@ Parameter: ## Search for projects by name -Search for projects by name which are accessible to the authenticated user. +Search for projects by name which are accessible to the authenticated user. This +endpoint can be accessed without authentication if the project is publicly +accessible. ``` GET /projects/search/:query -- cgit v1.2.1