Commit 024e0348904179a8dea81c01e27a5f014cf57499
1 parent
7b33d8cb
Exists in
master
and in
4 other branches
update API docs
Showing
2 changed files
with
182 additions
and
0 deletions
Show diff stats
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 |
| 27 | 27 | |
| 28 | 28 | + [Users](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/users.md) |
| 29 | 29 | + [Projects](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md) |
| 30 | ++ [Issues](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/issues.md) | ... | ... |
| ... | ... | @@ -0,0 +1,181 @@ |
| 1 | +## List issues | |
| 2 | + | |
| 3 | +Get all issues created by authenticed user. | |
| 4 | + | |
| 5 | +``` | |
| 6 | +GET /issues | |
| 7 | +``` | |
| 8 | + | |
| 9 | +```json | |
| 10 | +[ | |
| 11 | + { | |
| 12 | + "id": 43, | |
| 13 | + "title": "4xx/5xx pages", | |
| 14 | + "description": "", | |
| 15 | + "labels": [ ], | |
| 16 | + "milestone": null, | |
| 17 | + "assignee": null, | |
| 18 | + "author": { | |
| 19 | + "id": 1, | |
| 20 | + "email": "john@example.com", | |
| 21 | + "name": "John Smith", | |
| 22 | + "blocked": false, | |
| 23 | + "created_at": "2012-05-23T08:00:58Z" | |
| 24 | + }, | |
| 25 | + "closed": true, | |
| 26 | + "updated_at": "2012-07-02T17:53:12Z", | |
| 27 | + "created_at": "2012-07-02T17:53:12Z" | |
| 28 | + }, | |
| 29 | + { | |
| 30 | + "id": 42, | |
| 31 | + "title": "Add user settings", | |
| 32 | + "description": "", | |
| 33 | + "labels": [ | |
| 34 | + "feature" | |
| 35 | + ], | |
| 36 | + "milestone": { | |
| 37 | + "id": 1, | |
| 38 | + "title": "v1.0", | |
| 39 | + "description": "", | |
| 40 | + "due_date": "2012-07-20", | |
| 41 | + "closed": false, | |
| 42 | + "updated_at": "2012-07-04T13:42:48Z", | |
| 43 | + "created_at": "2012-07-04T13:42:48Z" | |
| 44 | + }, | |
| 45 | + "assignee": { | |
| 46 | + "id": 2, | |
| 47 | + "email": "jack@example.com", | |
| 48 | + "name": "Jack Smith", | |
| 49 | + "blocked": false, | |
| 50 | + "created_at": "2012-05-23T08:01:01Z" | |
| 51 | + }, | |
| 52 | + "author": { | |
| 53 | + "id": 1, | |
| 54 | + "email": "john@example.com", | |
| 55 | + "name": "John Smith", | |
| 56 | + "blocked": false, | |
| 57 | + "created_at": "2012-05-23T08:00:58Z" | |
| 58 | + }, | |
| 59 | + "closed": false, | |
| 60 | + "updated_at": "2012-07-12T13:43:19Z", | |
| 61 | + "created_at": "2012-06-28T12:58:06Z" | |
| 62 | + } | |
| 63 | +] | |
| 64 | +``` | |
| 65 | + | |
| 66 | +## List project issues | |
| 67 | + | |
| 68 | +Get a list of project issues. | |
| 69 | + | |
| 70 | +``` | |
| 71 | +GET /projects/:id/issues | |
| 72 | +``` | |
| 73 | + | |
| 74 | +Parameters: | |
| 75 | + | |
| 76 | ++ `id` (required) - The code name of a project | |
| 77 | + | |
| 78 | +## Single issue | |
| 79 | + | |
| 80 | +Get a project issue. | |
| 81 | + | |
| 82 | +``` | |
| 83 | +GET /projects/:id/issues/:issue_id | |
| 84 | +``` | |
| 85 | + | |
| 86 | +Parameters: | |
| 87 | + | |
| 88 | ++ `id` (required) - The code name of a project | |
| 89 | ++ `issue_id` (required) - The ID of a project issue | |
| 90 | + | |
| 91 | +```json | |
| 92 | +{ | |
| 93 | + "id": 42, | |
| 94 | + "title": "Add user settings", | |
| 95 | + "description": "", | |
| 96 | + "labels": [ | |
| 97 | + "feature" | |
| 98 | + ], | |
| 99 | + "milestone": { | |
| 100 | + "id": 1, | |
| 101 | + "title": "v1.0", | |
| 102 | + "description": "", | |
| 103 | + "due_date": "2012-07-20", | |
| 104 | + "closed": false, | |
| 105 | + "updated_at": "2012-07-04T13:42:48Z", | |
| 106 | + "created_at": "2012-07-04T13:42:48Z" | |
| 107 | + }, | |
| 108 | + "assignee": { | |
| 109 | + "id": 2, | |
| 110 | + "email": "jack@example.com", | |
| 111 | + "name": "Jack Smith", | |
| 112 | + "blocked": false, | |
| 113 | + "created_at": "2012-05-23T08:01:01Z" | |
| 114 | + }, | |
| 115 | + "author": { | |
| 116 | + "id": 1, | |
| 117 | + "email": "john@example.com", | |
| 118 | + "name": "John Smith", | |
| 119 | + "blocked": false, | |
| 120 | + "created_at": "2012-05-23T08:00:58Z" | |
| 121 | + }, | |
| 122 | + "closed": false, | |
| 123 | + "updated_at": "2012-07-12T13:43:19Z", | |
| 124 | + "created_at": "2012-06-28T12:58:06Z" | |
| 125 | +} | |
| 126 | +``` | |
| 127 | + | |
| 128 | +## New issue | |
| 129 | + | |
| 130 | +Create a new project issue. | |
| 131 | + | |
| 132 | +``` | |
| 133 | +POST /projects/:id/issues | |
| 134 | +``` | |
| 135 | + | |
| 136 | +Parameters: | |
| 137 | + | |
| 138 | ++ `id` (required) - The code name of a project | |
| 139 | ++ `title` (required) - The title of an issue | |
| 140 | ++ `description` (optional) - The description of an issue | |
| 141 | ++ `assignee_id` (optional) - The ID of a user to assign issue | |
| 142 | ++ `milestone_id` (optional) - The ID of a milestone to assign issue | |
| 143 | ++ `labels` (optional) - Comma-separated label names for an issue | |
| 144 | + | |
| 145 | +Will return created issue with status `201 Created` on success, or `404 Not found` on fail. | |
| 146 | + | |
| 147 | +## Edit issue | |
| 148 | + | |
| 149 | +Update an existing project issue. | |
| 150 | + | |
| 151 | +``` | |
| 152 | +PUT /projects/:id/issues/:issue_id | |
| 153 | +``` | |
| 154 | + | |
| 155 | +Parameters: | |
| 156 | + | |
| 157 | ++ `id` (required) - The code name of a project | |
| 158 | ++ `issue_id` (required) - The ID of a project's issue | |
| 159 | ++ `title` (optional) - The title of an issue | |
| 160 | ++ `description` (optional) - The description of an issue | |
| 161 | ++ `assignee_id` (optional) - The ID of a user to assign issue | |
| 162 | ++ `milestone_id` (optional) - The ID of a milestone to assign issue | |
| 163 | ++ `labels` (optional) - Comma-separated label names for an issue | |
| 164 | ++ `closed` (optional) - The state of an issue (0 = false, 1 = true) | |
| 165 | + | |
| 166 | +Will return updated issue with status `200 OK` on success, or `404 Not found` on fail. | |
| 167 | + | |
| 168 | +## Delete issue | |
| 169 | + | |
| 170 | +Delete existing project issue. | |
| 171 | + | |
| 172 | +``` | |
| 173 | +DELETE /projects/:id/issues/:issue_id | |
| 174 | +``` | |
| 175 | + | |
| 176 | +Parameters: | |
| 177 | + | |
| 178 | ++ `id` (required) - The code name of a project | |
| 179 | ++ `issue_id` (required) - The ID of a project's issue | |
| 180 | + | |
| 181 | +Status code `200` will be returned on success. | ... | ... |