diff options
author | Jeremy Anderson <jeremy@code-adept.com> | 2012-07-27 22:18:04 -0400 |
---|---|---|
committer | Jeremy Anderson <jeremy@code-adept.com> | 2012-07-27 22:18:04 -0400 |
commit | e6edaa3b502090f461b58c439ea476da2d37f039 (patch) | |
tree | a9cd55849df039f524ff2b5cbce55c38e9768e04 /doc/api | |
parent | 0301ba3315436a2dc466415ab0a3dd4fd7be3931 (diff) | |
parent | 3caf0aa89a964b8b3dcd21536e5bc274165ed2a2 (diff) | |
download | gitlab-ce-e6edaa3b502090f461b58c439ea476da2d37f039.tar.gz |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'doc/api')
-rw-r--r-- | doc/api/README.md | 1 | ||||
-rw-r--r-- | doc/api/issues.md | 184 | ||||
-rw-r--r-- | doc/api/projects.md | 22 |
3 files changed, 196 insertions, 11 deletions
diff --git a/doc/api/README.md b/doc/api/README.md index dcf75afda1f..e01119661f0 100644 --- a/doc/api/README.md +++ b/doc/api/README.md @@ -27,3 +27,4 @@ The API uses JSON to serialize data. You don't need to specify `.json` at the en + [Users](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/users.md) + [Projects](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md) ++ [Issues](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/issues.md) diff --git a/doc/api/issues.md b/doc/api/issues.md new file mode 100644 index 00000000000..aaad3305489 --- /dev/null +++ b/doc/api/issues.md @@ -0,0 +1,184 @@ +## List issues + +Get all issues created by authenticed user. + +``` +GET /issues +``` + +```json +[ + { + "id": 43, + "project_id": 8, + "title": "4xx/5xx pages", + "description": "", + "labels": [ ], + "milestone": null, + "assignee": null, + "author": { + "id": 1, + "email": "john@example.com", + "name": "John Smith", + "blocked": false, + "created_at": "2012-05-23T08:00:58Z" + }, + "closed": true, + "updated_at": "2012-07-02T17:53:12Z", + "created_at": "2012-07-02T17:53:12Z" + }, + { + "id": 42, + "project_id": 8, + "title": "Add user settings", + "description": "", + "labels": [ + "feature" + ], + "milestone": { + "id": 1, + "title": "v1.0", + "description": "", + "due_date": "2012-07-20", + "closed": false, + "updated_at": "2012-07-04T13:42:48Z", + "created_at": "2012-07-04T13:42:48Z" + }, + "assignee": { + "id": 2, + "email": "jack@example.com", + "name": "Jack Smith", + "blocked": false, + "created_at": "2012-05-23T08:01:01Z" + }, + "author": { + "id": 1, + "email": "john@example.com", + "name": "John Smith", + "blocked": false, + "created_at": "2012-05-23T08:00:58Z" + }, + "closed": false, + "updated_at": "2012-07-12T13:43:19Z", + "created_at": "2012-06-28T12:58:06Z" + } +] +``` + +## List project issues + +Get a list of project issues. + +``` +GET /projects/:id/issues +``` + +Parameters: + ++ `id` (required) - The ID or code name of a project + +## Single issue + +Get a project issue. + +``` +GET /projects/:id/issues/:issue_id +``` + +Parameters: + ++ `id` (required) - The ID or code name of a project ++ `issue_id` (required) - The ID of a project issue + +```json +{ + "id": 42, + "project_id": 8, + "title": "Add user settings", + "description": "", + "labels": [ + "feature" + ], + "milestone": { + "id": 1, + "title": "v1.0", + "description": "", + "due_date": "2012-07-20", + "closed": false, + "updated_at": "2012-07-04T13:42:48Z", + "created_at": "2012-07-04T13:42:48Z" + }, + "assignee": { + "id": 2, + "email": "jack@example.com", + "name": "Jack Smith", + "blocked": false, + "created_at": "2012-05-23T08:01:01Z" + }, + "author": { + "id": 1, + "email": "john@example.com", + "name": "John Smith", + "blocked": false, + "created_at": "2012-05-23T08:00:58Z" + }, + "closed": false, + "updated_at": "2012-07-12T13:43:19Z", + "created_at": "2012-06-28T12:58:06Z" +} +``` + +## New issue + +Create a new project issue. + +``` +POST /projects/:id/issues +``` + +Parameters: + ++ `id` (required) - The ID or code name of a project ++ `title` (required) - The title of an issue ++ `description` (optional) - The description of an issue ++ `assignee_id` (optional) - The ID of a user to assign issue ++ `milestone_id` (optional) - The ID of a milestone to assign issue ++ `labels` (optional) - Comma-separated label names for an issue + +Will return created issue with status `201 Created` on success, or `404 Not found` on fail. + +## Edit issue + +Update an existing project issue. + +``` +PUT /projects/:id/issues/:issue_id +``` + +Parameters: + ++ `id` (required) - The ID or code name of a project ++ `issue_id` (required) - The ID of a project's issue ++ `title` (optional) - The title of an issue ++ `description` (optional) - The description of an issue ++ `assignee_id` (optional) - The ID of a user to assign issue ++ `milestone_id` (optional) - The ID of a milestone to assign issue ++ `labels` (optional) - Comma-separated label names for an issue ++ `closed` (optional) - The state of an issue (0 = false, 1 = true) + +Will return updated issue with status `200 OK` on success, or `404 Not found` on fail. + +## Delete issue + +Delete existing project issue. + +``` +DELETE /projects/:id/issues/:issue_id +``` + +Parameters: + ++ `id` (required) - The ID or code name of a project ++ `issue_id` (required) - The ID of a project's issue + +Status code `200` will be returned on success. diff --git a/doc/api/projects.md b/doc/api/projects.md index c748745e063..cd94cd42328 100644 --- a/doc/api/projects.md +++ b/doc/api/projects.md @@ -1,6 +1,6 @@ ## List projects -Get a list of authenticated users' projects. +Get a list of authenticated user's projects. ``` GET /projects @@ -63,7 +63,7 @@ GET /projects/:id Parameters: -+ `id` (required) - The code name of a project ++ `id` (required) - The ID or code name of a project ```json { @@ -91,7 +91,7 @@ Parameters: ## Project repository branches -Get a list of project repository branches. +Get a list of project repository branches sorted by name alphabetically. ``` GET /projects/:id/repository/branches @@ -99,7 +99,7 @@ GET /projects/:id/repository/branches Parameters: -+ `id` (required) - The code name of a project ++ `id` (required) - The ID or code name of a project ```json [ @@ -131,7 +131,7 @@ Parameters: ## Project repository tags -Get a list of project repository tags. +Get a list of project repository tags sorted by name in reverse alphabetical order. ``` GET /projects/:id/repository/tags @@ -139,7 +139,7 @@ GET /projects/:id/repository/tags Parameters: -+ `id` (required) - The code name of a project ++ `id` (required) - The ID or code name of a project ```json [ @@ -183,7 +183,7 @@ GET /projects/:id/snippets/:snippet_id Parameters: -+ `id` (required) - The code name of a project ++ `id` (required) - The ID or code name of a project + `snippet_id` (required) - The ID of a project's snippet ```json @@ -214,7 +214,7 @@ GET /projects/:id/snippets/:snippet_id/raw Parameters: -+ `id` (required) - The code name of a project ++ `id` (required) - The ID or code name of a project + `snippet_id` (required) - The ID of a project's snippet ## New snippet @@ -227,7 +227,7 @@ POST /projects/:id/snippets Parameters: -+ `id` (required) - The code name of a project ++ `id` (required) - The ID or code name of a project + `title` (required) - The title of a snippet + `file_name` (required) - The name of a snippet file + `lifetime` (optional) - The expiration date of a snippet @@ -245,7 +245,7 @@ PUT /projects/:id/snippets/:snippet_id Parameters: -+ `id` (required) - The code name of a project ++ `id` (required) - The ID or code name of a project + `snippet_id` (required) - The ID of a project's snippet + `title` (optional) - The title of a snippet + `file_name` (optional) - The name of a snippet file @@ -264,7 +264,7 @@ DELETE /projects/:id/snippets/:snippet_id Parameters: -+ `id` (required) - The code name of a project ++ `id` (required) - The ID or code name of a project + `snippet_id` (required) - The ID of a project's snippet Status code `200` will be returned on success. |