BigW Consortium Gitlab

notes.md 3.95 KB
Newer Older
1 2
# Notes

3
Notes are comments on snippets, issues or merge requests.
4 5 6 7 8 9

## Issues

### List project issue notes

Gets a list of all notes for a single issue.
Nihad Abbasov committed
10 11 12 13 14 15 16

```
GET /projects/:id/issues/:issue_id/notes
```

Parameters:

17
+ `id` (required) - The ID of a project
Nihad Abbasov committed
18 19
+ `issue_id` (required) - The ID of an issue

20 21 22
```json
[
  {
23 24 25 26 27 28 29 30 31 32
    "id": 302,
    "body": "_Status changed to closed_",
    "attachment": null,
    "author": {
      "id": 1,
      "username": "pipin",
      "email": "admin@example.com",
      "name": "Pip",
      "state": "active",
      "created_at": "2013-09-30T13:46:01Z"
33
    },
34
    "created_at": "2013-10-02T09:22:45Z"
35 36
  },
  {
37 38 39 40 41 42 43 44 45 46
    "id": 305,
    "body": "Text of the comment\r\n",
    "attachment": null,
    "author": {
      "id": 1,
      "username": "pipin",
      "email": "admin@example.com",
      "name": "Pip",
      "state": "active",
      "created_at": "2013-09-30T13:46:01Z"
47
    },
48
    "created_at": "2013-10-02T09:56:03Z"
49 50 51
  }
]
```
52 53 54 55

### Get single issue note

Returns a single note for a specific project issue
Nihad Abbasov committed
56 57

```
58
GET /projects/:id/issues/:issue_id/notes/:note_id
Nihad Abbasov committed
59 60 61 62
```

Parameters:

63
+ `id` (required) - The ID of a project
64 65 66
+ `issue_id` (required) - The ID of a project issue
+ `note_id` (required) - The ID of an issue note

Nihad Abbasov committed
67

68
### Create new issue note
69

70
Creates a new note to a single project issue.
71 72

```
73
POST /projects/:id/issues/:issue_id/notes
74 75 76 77
```

Parameters:

78
+ `id` (required) - The ID of a project
79 80 81 82 83 84 85 86 87
+ `issue_id` (required) - The ID of an issue
+ `body` (required) - The content of a note


## Snippets

### List all snippet notes

Gets a list of all notes for a single snippet. Snippet notes are comments users can post to a snippet.
Nihad Abbasov committed
88 89

```
90
GET /projects/:id/snippets/:snippet_id/notes
Nihad Abbasov committed
91 92 93 94
```

Parameters:

95
+ `id` (required) - The ID of a project
96 97
+ `snippet_id` (required) - The ID of a project snippet

Nihad Abbasov committed
98

99
### Get single snippet note
Nihad Abbasov committed
100

101
Returns a single note for a given snippet.
Nihad Abbasov committed
102 103

```
104
GET /projects/:id/snippets/:snippet_id/notes/:note_id
Nihad Abbasov committed
105 106 107 108
```

Parameters:

109
+ `id` (required) - The ID of a project
Nihad Abbasov committed
110 111 112
+ `snippet_id` (required) - The ID of a project snippet
+ `note_id` (required) - The ID of an snippet note

113 114
```json
{
115 116 117 118 119 120 121 122 123 124
  "id": 52,
  "title": "Snippet",
  "file_name": "snippet.rb",
  "author": {
    "id": 1,
    "username": "pipin",
    "email": "admin@example.com",
    "name": "Pip",
    "state": "active",
    "created_at": "2013-09-30T13:46:01Z"
125
  },
126 127 128
  "expires_at": null,
  "updated_at": "2013-10-02T07:34:20Z",
  "created_at": "2013-10-02T07:34:20Z"
129 130
}
```
131 132 133 134

### Create new snippet note

Creates a new note for a single snippet. Snippet notes are comments users can post to a snippet.
135 136

```
137
POST /projects/:id/snippets/:snippet_id/notes
138 139 140 141
```

Parameters:

142
+ `id` (required) - The ID of a project
143
+ `snippet_id` (required) - The ID of an snippet
144 145
+ `body` (required) - The content of a note

146 147 148 149 150 151

## Merge Requests

### List all merge request notes

Gets a list of all notes for a single merge request.
Nihad Abbasov committed
152 153

```
154
GET /projects/:id/merge_requests/:merge_request_id/notes
Nihad Abbasov committed
155 156 157 158
```

Parameters:

159
+ `id` (required) - The ID of a project
160 161
+ `merge_request_id` (required) - The ID of a project merge request

Nihad Abbasov committed
162

163 164 165
### Get single merge request note

Returns a single note for a given merge request.
Nihad Abbasov committed
166 167

```
168
GET /projects/:id/merge_requests/:merge_request_id/notes/:note_id
Nihad Abbasov committed
169 170 171 172
```

Parameters:

173
+ `id` (required) - The ID of a project
174 175 176
+ `merge_request_id` (required) - The ID of a project merge request
+ `note_id` (required) - The ID of a merge request note

177 178
```json
{
179 180 181 182 183 184 185 186 187 188
  "id": 301,
  "body": "Comment for MR",
  "attachment": null,
  "author": {
    "id": 1,
    "username": "pipin",
    "email": "admin@example.com",
    "name": "Pip",
    "state": "active",
    "created_at": "2013-09-30T13:46:01Z"
189
  },
190
  "created_at": "2013-10-02T08:57:14Z"
191 192
}
```
193 194 195 196 197 198 199 200 201 202 203 204 205

### Create new merge request note

Creates a new note for a single merge request.

```
POST /projects/:id/merge_requests/:merge_request_id/notes
```

Parameters:

+ `id` (required) - The ID of a project
+ `merge_request_id` (required) - The ID of a merge request
Nihad Abbasov committed
206 207
+ `body` (required) - The content of a note