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:

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

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:

Ciro Santilli committed
63 64 65
- `id` (required) - The ID of a project
- `issue_id` (required) - The ID of a project issue
- `note_id` (required) - The ID of an issue note
Nihad Abbasov committed
66

67
### Create new issue note
68

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

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

Parameters:

Ciro Santilli committed
77 78 79
- `id` (required) - The ID of a project
- `issue_id` (required) - The ID of an issue
- `body` (required) - The content of a note
80 81 82 83 84 85

## 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
86 87

```
88
GET /projects/:id/snippets/:snippet_id/notes
Nihad Abbasov committed
89 90 91 92
```

Parameters:

Ciro Santilli committed
93 94
- `id` (required) - The ID of a project
- `snippet_id` (required) - The ID of a project snippet
Nihad Abbasov committed
95

96
### Get single snippet note
Nihad Abbasov committed
97

98
Returns a single note for a given snippet.
Nihad Abbasov committed
99 100

```
101
GET /projects/:id/snippets/:snippet_id/notes/:note_id
Nihad Abbasov committed
102 103 104 105
```

Parameters:

Ciro Santilli committed
106 107 108
- `id` (required) - The ID of a project
- `snippet_id` (required) - The ID of a project snippet
- `note_id` (required) - The ID of an snippet note
Nihad Abbasov committed
109

110 111
```json
{
112 113 114 115 116 117 118 119 120 121
  "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"
122
  },
123 124 125
  "expires_at": null,
  "updated_at": "2013-10-02T07:34:20Z",
  "created_at": "2013-10-02T07:34:20Z"
126 127
}
```
128 129 130 131

### Create new snippet note

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

```
134
POST /projects/:id/snippets/:snippet_id/notes
135 136 137 138
```

Parameters:

Ciro Santilli committed
139 140 141
- `id` (required) - The ID of a project
- `snippet_id` (required) - The ID of an snippet
- `body` (required) - The content of a note
142 143 144 145 146 147

## Merge Requests

### List all merge request notes

Gets a list of all notes for a single merge request.
Nihad Abbasov committed
148 149

```
150
GET /projects/:id/merge_requests/:merge_request_id/notes
Nihad Abbasov committed
151 152 153 154
```

Parameters:

Ciro Santilli committed
155 156
- `id` (required) - The ID of a project
- `merge_request_id` (required) - The ID of a project merge request
Nihad Abbasov committed
157

158 159 160
### Get single merge request note

Returns a single note for a given merge request.
Nihad Abbasov committed
161 162

```
163
GET /projects/:id/merge_requests/:merge_request_id/notes/:note_id
Nihad Abbasov committed
164 165 166 167
```

Parameters:

Ciro Santilli committed
168 169 170
- `id` (required) - The ID of a project
- `merge_request_id` (required) - The ID of a project merge request
- `note_id` (required) - The ID of a merge request note
171

172 173
```json
{
174 175 176 177 178 179 180 181 182 183
  "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"
184
  },
185
  "created_at": "2013-10-02T08:57:14Z"
186 187
}
```
188 189 190 191 192 193 194 195 196 197 198

### Create new merge request note

Creates a new note for a single merge request.

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

Parameters:

Ciro Santilli committed
199 200 201
- `id` (required) - The ID of a project
- `merge_request_id` (required) - The ID of a merge request
- `body` (required) - The content of a note