308.md 41.7 KB
Newer Older
Lab机器人's avatar
readme  
Lab机器人 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790
# Discussions API

> 原文:[https://docs.gitlab.com/ee/api/discussions.html](https://docs.gitlab.com/ee/api/discussions.html)

*   [Discussions pagination](#discussions-pagination)
*   [Issues](#issues)
    *   [List project issue discussion items](#list-project-issue-discussion-items)
    *   [Get single issue discussion item](#get-single-issue-discussion-item)
    *   [Create new issue thread](#create-new-issue-thread)
    *   [Add note to existing issue thread](#add-note-to-existing-issue-thread)
    *   [Modify existing issue thread note](#modify-existing-issue-thread-note)
    *   [Delete an issue thread note](#delete-an-issue-thread-note)
*   [Snippets](#snippets)
    *   [List project snippet discussion items](#list-project-snippet-discussion-items)
    *   [Get single snippet discussion item](#get-single-snippet-discussion-item)
    *   [Create new snippet thread](#create-new-snippet-thread)
    *   [Add note to existing snippet thread](#add-note-to-existing-snippet-thread)
    *   [Modify existing snippet thread note](#modify-existing-snippet-thread-note)
    *   [Delete a snippet thread note](#delete-a-snippet-thread-note)
*   [Epics](#epics-ultimate)
    *   [List group epic discussion items](#list-group-epic-discussion-items)
    *   [Get single epic discussion item](#get-single-epic-discussion-item)
    *   [Create new epic thread](#create-new-epic-thread)
    *   [Add note to existing epic thread](#add-note-to-existing-epic-thread)
    *   [Modify existing epic thread note](#modify-existing-epic-thread-note)
    *   [Delete an epic thread note](#delete-an-epic-thread-note)
*   [Merge requests](#merge-requests)
    *   [List project merge request discussion items](#list-project-merge-request-discussion-items)
    *   [Get single merge request discussion item](#get-single-merge-request-discussion-item)
    *   [Create new merge request thread](#create-new-merge-request-thread)
    *   [Resolve a merge request thread](#resolve-a-merge-request-thread)
    *   [Add note to existing merge request thread](#add-note-to-existing-merge-request-thread)
    *   [Modify an existing merge request thread note](#modify-an-existing-merge-request-thread-note)
    *   [Delete a merge request thread note](#delete-a-merge-request-thread-note)
*   [Commits](#commits)
    *   [List project commit discussion items](#list-project-commit-discussion-items)
    *   [Get single commit discussion item](#get-single-commit-discussion-item)
    *   [Create new commit thread](#create-new-commit-thread)
    *   [Add note to existing commit thread](#add-note-to-existing-commit-thread)
    *   [Modify an existing commit thread note](#modify-an-existing-commit-thread-note)
    *   [Delete a commit thread note](#delete-a-commit-thread-note)

# Discussions API[](#discussions-api "Permalink")

讨论是关于以下方面的一组相关注释:

*   Snippets
*   Issues
*   Epics
*   合并要求
*   Commits

这包括系统注释,这些注释是有关对象更改的注释(例如,当里程碑更改时,将有相应的系统注释). 标签注释不是此 API 的一部分,而是在[资源标签事件中](resource_label_events.html)记录为单独的[事件](resource_label_events.html) .

## Discussions pagination[](#discussions-pagination "Permalink")

默认情况下,因为 API 结果是分页的,所以`GET`请求一次返回 20 个结果.

阅读有关[分页的](README.html#pagination)更多信息.

## Issues[](#issues "Permalink")

### List project issue discussion items[](#list-project-issue-discussion-items "Permalink")

获取单个问题的所有讨论项目的列表.

```
GET /projects/:id/issues/:issue_iid/discussions 
```

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 项目的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `issue_iid` | integer | yes | 问题的 IID |

```
[  {  "id":  "6a9c1750b37d513a43987b574953fceb50b03ce7",  "individual_note":  false,  "notes":  [  {  "id":  1126,  "type":  "DiscussionNote",  "body":  "discussion text",  "attachment":  null,  "author":  {  "id":  1,  "name":  "root",  "username":  "root",  "state":  "active",  "avatar_url":  "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",  "web_url":  "http://localhost:3000/root"  },  "created_at":  "2018-03-03T21:54:39.668Z",  "updated_at":  "2018-03-03T21:54:39.668Z",  "system":  false,  "noteable_id":  3,  "noteable_type":  "Issue",  "noteable_iid":  null  },  {  "id":  1129,  "type":  "DiscussionNote",  "body":  "reply to the discussion",  "attachment":  null,  "author":  {  "id":  1,  "name":  "root",  "username":  "root",  "state":  "active",  "avatar_url":  "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",  "web_url":  "http://localhost:3000/root"  },  "created_at":  "2018-03-04T13:38:02.127Z",  "updated_at":  "2018-03-04T13:38:02.127Z",  "system":  false,  "noteable_id":  3,  "noteable_type":  "Issue",  "noteable_iid":  null,  "resolvable":  false  }  ]  },  {  "id":  "87805b7c09016a7058e91bdbe7b29d1f284a39e6",  "individual_note":  true,  "notes":  [  {  "id":  1128,  "type":  null,  "body":  "a single comment",  "attachment":  null,  "author":  {  "id":  1,  "name":  "root",  "username":  "root",  "state":  "active",  "avatar_url":  "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",  "web_url":  "http://localhost:3000/root"  },  "created_at":  "2018-03-04T09:17:22.520Z",  "updated_at":  "2018-03-04T09:17:22.520Z",  "system":  false,  "noteable_id":  3,  "noteable_type":  "Issue",  "noteable_iid":  null,  "resolvable":  false  }  ]  }  ] 
```

```
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/issues/11/discussions" 
```

### Get single issue discussion item[](#get-single-issue-discussion-item "Permalink")

返回特定项目问题的单个讨论项

```
GET /projects/:id/issues/:issue_iid/discussions/:discussion_id 
```

Parameters:

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 项目的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `issue_iid` | integer | yes | 问题的 IID |
| `discussion_id` | integer | yes | 讨论项目的 ID |

```
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/issues/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7" 
```

### Create new issue thread[](#create-new-issue-thread "Permalink")

为单个项目问题创建一个新线程. 这类似于创建便笺,但其他注释(回复)可以在以后添加.

```
POST /projects/:id/issues/:issue_iid/discussions 
```

Parameters:

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 项目的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `issue_iid` | integer | yes | 问题的 IID |
| `body` | string | yes | 线程的内容 |
| `created_at` | string | no | 日期时间字符串,ISO 8601 格式,例如 2016-03-11T03:45:40Z(需要管理员或项目/组所有者权限) |

```
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/issues/11/discussions?body=comment" 
```

### Add note to existing issue thread[](#add-note-to-existing-issue-thread "Permalink")

向该线程添加新注释. 这也可以[从单个注释创建线程](../user/discussions/#start-a-thread-by-replying-to-a-standard-comment) .

**警告**注释可以添加到注释(系统注释等)之外的其他项目中,从而使其成为主题.

```
POST /projects/:id/issues/:issue_iid/discussions/:discussion_id/notes 
```

Parameters:

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 项目的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `issue_iid` | integer | yes | 问题的 IID |
| `discussion_id` | integer | yes | 线程的 ID |
| `note_id` | integer | yes | 线程注释的 ID |
| `body` | string | yes | 备注/回复的内容 |
| `created_at` | string | no | 日期时间字符串,ISO 8601 格式,例如 2016-03-11T03:45:40Z(需要管理员或项目/组所有者权限) |

```
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/issues/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7/notes?body=comment" 
```

### Modify existing issue thread note[](#modify-existing-issue-thread-note "Permalink")

修改问题的现有线程注释.

```
PUT /projects/:id/issues/:issue_iid/discussions/:discussion_id/notes/:note_id 
```

Parameters:

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 项目的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `issue_iid` | integer | yes | 问题的 IID |
| `discussion_id` | integer | yes | 线程的 ID |
| `note_id` | integer | yes | 线程注释的 ID |
| `body` | string | yes | 备注/回复的内容 |

```
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/issues/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7/notes/1108?body=comment" 
```

### Delete an issue thread note[](#delete-an-issue-thread-note "Permalink")

删除问题的现有主题注释.

```
DELETE /projects/:id/issues/:issue_iid/discussions/:discussion_id/notes/:note_id 
```

Parameters:

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 项目的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `issue_iid` | integer | yes | 问题的 IID |
| `discussion_id` | integer | yes | 讨论的 ID |
| `note_id` | integer | yes | 讨论记录的 ID |

```
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/issues/11/discussions/636" 
```

## Snippets[](#snippets "Permalink")

### List project snippet discussion items[](#list-project-snippet-discussion-items "Permalink")

获取单个代码段的所有讨论项的列表.

```
GET /projects/:id/snippets/:snippet_id/discussions 
```

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 项目的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `snippet_id` | integer | yes | 片段的 ID |

```
[  {  "id":  "6a9c1750b37d513a43987b574953fceb50b03ce7",  "individual_note":  false,  "notes":  [  {  "id":  1126,  "type":  "DiscussionNote",  "body":  "discussion text",  "attachment":  null,  "author":  {  "id":  1,  "name":  "root",  "username":  "root",  "state":  "active",  "avatar_url":  "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",  "web_url":  "http://localhost:3000/root"  },  "created_at":  "2018-03-03T21:54:39.668Z",  "updated_at":  "2018-03-03T21:54:39.668Z",  "system":  false,  "noteable_id":  3,  "noteable_type":  "Snippet",  "noteable_id":  null  },  {  "id":  1129,  "type":  "DiscussionNote",  "body":  "reply to the discussion",  "attachment":  null,  "author":  {  "id":  1,  "name":  "root",  "username":  "root",  "state":  "active",  "avatar_url":  "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",  "web_url":  "http://localhost:3000/root"  },  "created_at":  "2018-03-04T13:38:02.127Z",  "updated_at":  "2018-03-04T13:38:02.127Z",  "system":  false,  "noteable_id":  3,  "noteable_type":  "Snippet",  "noteable_id":  null,  "resolvable":  false  }  ]  },  {  "id":  "87805b7c09016a7058e91bdbe7b29d1f284a39e6",  "individual_note":  true,  "notes":  [  {  "id":  1128,  "type":  null,  "body":  "a single comment",  "attachment":  null,  "author":  {  "id":  1,  "name":  "root",  "username":  "root",  "state":  "active",  "avatar_url":  "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",  "web_url":  "http://localhost:3000/root"  },  "created_at":  "2018-03-04T09:17:22.520Z",  "updated_at":  "2018-03-04T09:17:22.520Z",  "system":  false,  "noteable_id":  3,  "noteable_type":  "Snippet",  "noteable_id":  null,  "resolvable":  false  }  ]  }  ] 
```

```
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/snippets/11/discussions" 
```

### Get single snippet discussion item[](#get-single-snippet-discussion-item "Permalink")

返回特定项目片段的单个讨论项

```
GET /projects/:id/snippets/:snippet_id/discussions/:discussion_id 
```

Parameters:

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 项目的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `snippet_id` | integer | yes | 片段的 ID |
| `discussion_id` | integer | yes | 讨论项目的 ID |

```
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/snippets/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7" 
```

### Create new snippet thread[](#create-new-snippet-thread "Permalink")

Creates a new thread to a single project snippet. This is similar to creating a note but other comments (replies) can be added to it later.

```
POST /projects/:id/snippets/:snippet_id/discussions 
```

Parameters:

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 项目的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `snippet_id` | integer | yes | 片段的 ID |
| `body` | string | yes | 讨论内容 |
| `created_at` | string | no | 日期时间字符串,ISO 8601 格式,例如 2016-03-11T03:45:40Z(需要管理员或项目/组所有者权限) |

```
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/snippets/11/discussions?body=comment" 
```

### Add note to existing snippet thread[](#add-note-to-existing-snippet-thread "Permalink")

向该线程添加新注释.

```
POST /projects/:id/snippets/:snippet_id/discussions/:discussion_id/notes 
```

Parameters:

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 项目的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `snippet_id` | integer | yes | 片段的 ID |
| `discussion_id` | integer | yes | 线程的 ID |
| `note_id` | integer | yes | 线程注释的 ID |
| `body` | string | yes | 备注/回复的内容 |
| `created_at` | string | no | 日期时间字符串,ISO 8601 格式,例如 2016-03-11T03:45:40Z(需要管理员或项目/组所有者权限) |

```
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/snippets/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7/notes?body=comment" 
```

### Modify existing snippet thread note[](#modify-existing-snippet-thread-note "Permalink")

修改代码段的现有线程注释.

```
PUT /projects/:id/snippets/:snippet_id/discussions/:discussion_id/notes/:note_id 
```

Parameters:

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 项目的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `snippet_id` | integer | yes | 片段的 ID |
| `discussion_id` | integer | yes | 线程的 ID |
| `note_id` | integer | yes | 线程注释的 ID |
| `body` | string | yes | 备注/回复的内容 |

```
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/snippets/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7/notes/1108?body=comment" 
```

### Delete a snippet thread note[](#delete-a-snippet-thread-note "Permalink")

删除代码段的现有线程注释.

```
DELETE /projects/:id/snippets/:snippet_id/discussions/:discussion_id/notes/:note_id 
```

Parameters:

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 项目的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `snippet_id` | integer | yes | 片段的 ID |
| `discussion_id` | integer | yes | 讨论的 ID |
| `note_id` | integer | yes | 讨论记录的 ID |

```
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/snippets/11/discussions/636" 
```

## Epics[](#epics-ultimate "Permalink")

### List group epic discussion items[](#list-group-epic-discussion-items "Permalink")

获取单个史诗的所有讨论项的列表.

```
GET /groups/:id/epics/:epic_id/discussions 
```

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 组的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `epic_id` | integer | yes | 史诗的 ID |

```
[  {  "id":  "6a9c1750b37d513a43987b574953fceb50b03ce7",  "individual_note":  false,  "notes":  [  {  "id":  1126,  "type":  "DiscussionNote",  "body":  "discussion text",  "attachment":  null,  "author":  {  "id":  1,  "name":  "root",  "username":  "root",  "state":  "active",  "avatar_url":  "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",  "web_url":  "http://localhost:3000/root"  },  "created_at":  "2018-03-03T21:54:39.668Z",  "updated_at":  "2018-03-03T21:54:39.668Z",  "system":  false,  "noteable_id":  3,  "noteable_type":  "Epic",  "noteable_id":  null,  "resolvable":  false  },  {  "id":  1129,  "type":  "DiscussionNote",  "body":  "reply to the discussion",  "attachment":  null,  "author":  {  "id":  1,  "name":  "root",  "username":  "root",  "state":  "active",  "avatar_url":  "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",  "web_url":  "http://localhost:3000/root"  },  "created_at":  "2018-03-04T13:38:02.127Z",  "updated_at":  "2018-03-04T13:38:02.127Z",  "system":  false,  "noteable_id":  3,  "noteable_type":  "Epic",  "noteable_id":  null,  "resolvable":  false  }  ]  },  {  "id":  "87805b7c09016a7058e91bdbe7b29d1f284a39e6",  "individual_note":  true,  "notes":  [  {  "id":  1128,  "type":  null,  "body":  "a single comment",  "attachment":  null,  "author":  {  "id":  1,  "name":  "root",  "username":  "root",  "state":  "active",  "avatar_url":  "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",  "web_url":  "http://localhost:3000/root"  },  "created_at":  "2018-03-04T09:17:22.520Z",  "updated_at":  "2018-03-04T09:17:22.520Z",  "system":  false,  "noteable_id":  3,  "noteable_type":  "Epic",  "noteable_id":  null,  "resolvable":  false  }  ]  }  ] 
```

```
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/epics/11/discussions" 
```

### Get single epic discussion item[](#get-single-epic-discussion-item "Permalink")

返回特定小组史诗的单个讨论项

```
GET /groups/:id/epics/:epic_id/discussions/:discussion_id 
```

Parameters:

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 组的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `epic_id` | integer | yes | 史诗的 ID |
| `discussion_id` | integer | yes | 讨论项目的 ID |

```
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/epics/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7" 
```

### Create new epic thread[](#create-new-epic-thread "Permalink")

Creates a new thread to a single group epic. This is similar to creating a note but other comments (replies) can be added to it later.

```
POST /groups/:id/epics/:epic_id/discussions 
```

Parameters:

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 组的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `epic_id` | integer | yes | 史诗的 ID |
| `body` | string | yes | 线程的内容 |
| `created_at` | string | no | 日期时间字符串,ISO 8601 格式,例如 2016-03-11T03:45:40Z(需要管理员或项目/组所有者权限) |

```
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/epics/11/discussions?body=comment" 
```

### Add note to existing epic thread[](#add-note-to-existing-epic-thread "Permalink")

向该线程添加新注释. 这也可以[从单个注释创建线程](../user/discussions/#start-a-thread-by-replying-to-a-standard-comment) .

```
POST /groups/:id/epics/:epic_id/discussions/:discussion_id/notes 
```

Parameters:

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 组的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `epic_id` | integer | yes | 史诗的 ID |
| `discussion_id` | integer | yes | 线程的 ID |
| `note_id` | integer | yes | 线程注释的 ID |
| `body` | string | yes | 备注/回复的内容 |
| `created_at` | string | no | 日期时间字符串,ISO 8601 格式,例如 2016-03-11T03:45:40Z(需要管理员或项目/组所有者权限) |

```
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/epics/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7/notes?body=comment" 
```

### Modify existing epic thread note[](#modify-existing-epic-thread-note "Permalink")

修改史诗的现有线程注释.

```
PUT /groups/:id/epics/:epic_id/discussions/:discussion_id/notes/:note_id 
```

Parameters:

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 组的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `epic_id` | integer | yes | 史诗的 ID |
| `discussion_id` | integer | yes | 线程的 ID |
| `note_id` | integer | yes | 线程注释的 ID |
| `body` | string | yes | 备注/回复的内容 |

```
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/epics/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7/notes/1108?body=comment" 
```

### Delete an epic thread note[](#delete-an-epic-thread-note "Permalink")

删除史诗的现有主题注释.

```
DELETE /groups/:id/epics/:epic_id/discussions/:discussion_id/notes/:note_id 
```

Parameters:

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 组的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `epic_id` | integer | yes | 史诗的 ID |
| `discussion_id` | integer | yes | 线程的 ID |
| `note_id` | integer | yes | 线程注释的 ID |

```
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/epics/11/discussions/636" 
```

## Merge requests[](#merge-requests "Permalink")

### List project merge request discussion items[](#list-project-merge-request-discussion-items "Permalink")

获取单个合并请求的所有讨论项的列表.

```
GET /projects/:id/merge_requests/:merge_request_iid/discussions 
```

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 项目的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `merge_request_iid` | integer | yes | 合并请求的 IID |

```
[  {  "id":  "6a9c1750b37d513a43987b574953fceb50b03ce7",  "individual_note":  false,  "notes":  [  {  "id":  1126,  "type":  "DiscussionNote",  "body":  "discussion text",  "attachment":  null,  "author":  {  "id":  1,  "name":  "root",  "username":  "root",  "state":  "active",  "avatar_url":  "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",  "web_url":  "http://localhost:3000/root"  },  "created_at":  "2018-03-03T21:54:39.668Z",  "updated_at":  "2018-03-03T21:54:39.668Z",  "system":  false,  "noteable_id":  3,  "noteable_type":  "Merge request",  "noteable_iid":  null,  "resolved":  false,  "resolvable":  true,  "resolved_by":  null  },  {  "id":  1129,  "type":  "DiscussionNote",  "body":  "reply to the discussion",  "attachment":  null,  "author":  {  "id":  1,  "name":  "root",  "username":  "root",  "state":  "active",  "avatar_url":  "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",  "web_url":  "http://localhost:3000/root"  },  "created_at":  "2018-03-04T13:38:02.127Z",  "updated_at":  "2018-03-04T13:38:02.127Z",  "system":  false,  "noteable_id":  3,  "noteable_type":  "Merge request",  "noteable_iid":  null,  "resolved":  false,  "resolvable":  true,  "resolved_by":  null  }  ]  },  {  "id":  "87805b7c09016a7058e91bdbe7b29d1f284a39e6",  "individual_note":  true,  "notes":  [  {  "id":  1128,  "type":  null,  "body":  "a single comment",  "attachment":  null,  "author":  {  "id":  1,  "name":  "root",  "username":  "root",  "state":  "active",  "avatar_url":  "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",  "web_url":  "http://localhost:3000/root"  },  "created_at":  "2018-03-04T09:17:22.520Z",  "updated_at":  "2018-03-04T09:17:22.520Z",  "system":  false,  "noteable_id":  3,  "noteable_type":  "Merge request",  "noteable_iid":  null,  "resolved":  false,  "resolvable":  true,  "resolved_by":  null  }  ]  }  ] 
```

差异评论还包含以下位置:

```
[  {  "id":  "87805b7c09016a7058e91bdbe7b29d1f284a39e6",  "individual_note":  false,  "notes":  [  {  "id":  1128,  "type":  DiffNote,  "body":  "diff comment",  "attachment":  null,  "author":  {  "id":  1,  "name":  "root",  "username":  "root",  "state":  "active",  "avatar_url":  "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",  "web_url":  "http://localhost:3000/root"  },  "created_at":  "2018-03-04T09:17:22.520Z",  "updated_at":  "2018-03-04T09:17:22.520Z",  "system":  false,  "noteable_id":  3,  "noteable_type":  "Merge request",  "noteable_iid":  null,  "position":  {  "base_sha":  "b5d6e7b1613fca24d250fa8e5bc7bcc3dd6002ef",  "start_sha":  "7c9c2ead8a320fb7ba0b4e234bd9529a2614e306",  "head_sha":  "4803c71e6b1833ca72b8b26ef2ecd5adc8a38031",  "old_path":  "package.json",  "new_path":  "package.json",  "position_type":  "text",  "old_line":  27,  "new_line":  27,  "line_range":  {  "start":  {  "line_code":  "588440f66559714280628a4f9799f0c4eb880a4a_10_10",  "type":  "new",  },  "end":  {  "line_code":  "588440f66559714280628a4f9799f0c4eb880a4a_11_11",  "type":  "old"  },  }  },  "resolved":  false,  "resolvable":  true,  "resolved_by":  null  }  ]  }  ] 
```

```
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/merge_requests/11/discussions" 
```

### Get single merge request discussion item[](#get-single-merge-request-discussion-item "Permalink")

返回特定项目合并请求的单个讨论项

```
GET /projects/:id/merge_requests/:merge_request_iid/discussions/:discussion_id 
```

Parameters:

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 项目的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `merge_request_iid` | integer | yes | 合并请求的 IID |
| `discussion_id` | integer | yes | 讨论项目的 ID |

```
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/merge_requests/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7 
```

### Create new merge request thread[](#create-new-merge-request-thread "Permalink")

为单个项目合并请求创建一个新线程. 这类似于创建便笺,但其他注释(回复)可以在以后添加.

```
POST /projects/:id/merge_requests/:merge_request_iid/discussions 
```

Parameters:

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 项目的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `merge_request_iid` | integer | yes | 合并请求的 IID |
| `body` | string | yes | 线程的内容 |
| `created_at` | string | no | 日期时间字符串,ISO 8601 格式,例如 2016-03-11T03:45:40Z(需要管理员或项目/组所有者权限) |
| `position` | hash | no | 创建差异注释时的位置 |
| `position[base_sha]` | string | yes | 源分支中的基本提交 SHA |
| `position[start_sha]` | string | yes | SHA 引用目标分支中的提交 |
| `position[head_sha]` | string | yes | SHA 引用此合并请求的 HEAD |
| `position[position_type]` | string | yes | 位置参考的类型",允许的值:"文本"或"图像" |
| `position[new_path]` | string | no | 更改后的文件路径 |
| `position[new_line]` | integer | no | 更改后的行号(用于"文本"差异注释) |
| `position[old_path]` | string | no | 更改前的文件路径 |
| `position[old_line]` | integer | no | 更改前的行号(用于"文本"差异注释) |
| `position[line_range]` | hash | no | 多行差异注释的行范围 |
| `position[line_range][start]` | hash | no | 多行音符起始行 |
| `position[line_range][start][line_code]` | string | yes | 起始行的行代码 |
| `position[line_range][start][type]` | string | yes | 起始线的线型 |
| `position[line_range][end]` | hash | no | 多行注释结束行 |
| `position[line_range][end][line_code]` | string | yes | 结束行的行代码 |
| `position[line_range][end][type]` | string | yes | 终点线的线型 |
| `position[width]` | integer | no | 图片宽度(用于"图片"差异注释) |
| `position[height]` | integer | no | 图片的高度(用于"图片"差异注释) |
| `position[x]` | integer | no | X 坐标(用于"图像"差异注释) |
| `position[y]` | integer | no | Y 坐标(用于"图像"差异注释) |

```
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/merge_requests/11/discussions?body=comment" 
```

### Resolve a merge request thread[](#resolve-a-merge-request-thread "Permalink")

解决/取消解决合并请求的整个线程.

```
PUT /projects/:id/merge_requests/:merge_request_iid/discussions/:discussion_id 
```

Parameters:

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 项目的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `merge_request_iid` | integer | yes | 合并请求的 IID |
| `discussion_id` | integer | yes | 线程的 ID |
| `resolved` | boolean | yes | 解决/取消讨论 |

```
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/merge_requests/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7?resolved=true" 
```

### Add note to existing merge request thread[](#add-note-to-existing-merge-request-thread "Permalink")

向该线程添加新注释. 这也可以[从单个注释创建线程](../user/discussions/#start-a-thread-by-replying-to-a-standard-comment) .

```
POST /projects/:id/merge_requests/:merge_request_iid/discussions/:discussion_id/notes 
```

Parameters:

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 项目的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `merge_request_iid` | integer | yes | 合并请求的 IID |
| `discussion_id` | integer | yes | 线程的 ID |
| `note_id` | integer | yes | 线程注释的 ID |
| `body` | string | yes | 备注/回复的内容 |
| `created_at` | string | no | 日期时间字符串,ISO 8601 格式,例如 2016-03-11T03:45:40Z(需要管理员或项目/组所有者权限) |

```
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/merge_requests/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7/notes?body=comment" 
```

### Modify an existing merge request thread note[](#modify-an-existing-merge-request-thread-note "Permalink")

修改或解决合并请求的现有线程注释.

```
PUT /projects/:id/merge_requests/:merge_request_iid/discussions/:discussion_id/notes/:note_id 
```

Parameters:

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 项目的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `merge_request_iid` | integer | yes | 合并请求的 IID |
| `discussion_id` | integer | yes | 线程的 ID |
| `note_id` | integer | yes | 线程注释的 ID |
| `body` | string | no | 备注/回复的内容(必须是`body`或已`resolved`的内容之一) |
| `resolved` | boolean | no | 解析/取消解析音符(必须设置为刚好为`body`或已`resolved` |

```
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/merge_requests/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7/notes/1108?body=comment" 
```

解决注释:

```
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/merge_requests/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7/notes/1108?resolved=true" 
```

### Delete a merge request thread note[](#delete-a-merge-request-thread-note "Permalink")

删除合并请求的现有线程注释.

```
DELETE /projects/:id/merge_requests/:merge_request_iid/discussions/:discussion_id/notes/:note_id 
```

Parameters:

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 项目的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `merge_request_iid` | integer | yes | 合并请求的 IID |
| `discussion_id` | integer | yes | 线程的 ID |
| `note_id` | integer | yes | 线程注释的 ID |

```
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/merge_requests/11/discussions/636" 
```

## Commits[](#commits "Permalink")

### List project commit discussion items[](#list-project-commit-discussion-items "Permalink")

获取单个提交的所有讨论项的列表.

```
GET /projects/:id/commits/:commit_id/discussions 
```

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 项目的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `commit_id` | integer | yes | 提交的 ID |

```
[  {  "id":  "6a9c1750b37d513a43987b574953fceb50b03ce7",  "individual_note":  false,  "notes":  [  {  "id":  1126,  "type":  "DiscussionNote",  "body":  "discussion text",  "attachment":  null,  "author":  {  "id":  1,  "name":  "root",  "username":  "root",  "state":  "active",  "avatar_url":  "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",  "web_url":  "http://localhost:3000/root"  },  "created_at":  "2018-03-03T21:54:39.668Z",  "updated_at":  "2018-03-03T21:54:39.668Z",  "system":  false,  "noteable_id":  3,  "noteable_type":  "Commit",  "noteable_iid":  null,  "resolvable":  false  },  {  "id":  1129,  "type":  "DiscussionNote",  "body":  "reply to the discussion",  "attachment":  null,  "author":  {  "id":  1,  "name":  "root",  "username":  "root",  "state":  "active",  "avatar_url":  "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",  "web_url":  "http://localhost:3000/root"  },  "created_at":  "2018-03-04T13:38:02.127Z",  "updated_at":  "2018-03-04T13:38:02.127Z",  "system":  false,  "noteable_id":  3,  "noteable_type":  "Commit",  "noteable_iid":  null,  "resolvable":  false  }  ]  },  {  "id":  "87805b7c09016a7058e91bdbe7b29d1f284a39e6",  "individual_note":  true,  "notes":  [  {  "id":  1128,  "type":  null,  "body":  "a single comment",  "attachment":  null,  "author":  {  "id":  1,  "name":  "root",  "username":  "root",  "state":  "active",  "avatar_url":  "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",  "web_url":  "http://localhost:3000/root"  },  "created_at":  "2018-03-04T09:17:22.520Z",  "updated_at":  "2018-03-04T09:17:22.520Z",  "system":  false,  "noteable_id":  3,  "noteable_type":  "Commit",  "noteable_iid":  null,  "resolvable":  false  }  ]  }  ] 
```

差异评论还包含以下位置:

```
[  {  "id":  "87805b7c09016a7058e91bdbe7b29d1f284a39e6",  "individual_note":  false,  "notes":  [  {  "id":  1128,  "type":  DiffNote,  "body":  "diff comment",  "attachment":  null,  "author":  {  "id":  1,  "name":  "root",  "username":  "root",  "state":  "active",  "avatar_url":  "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",  "web_url":  "http://localhost:3000/root"  },  "created_at":  "2018-03-04T09:17:22.520Z",  "updated_at":  "2018-03-04T09:17:22.520Z",  "system":  false,  "noteable_id":  3,  "noteable_type":  "Commit",  "noteable_iid":  null,  "position":  {  "base_sha":  "b5d6e7b1613fca24d250fa8e5bc7bcc3dd6002ef",  "start_sha":  "7c9c2ead8a320fb7ba0b4e234bd9529a2614e306",  "head_sha":  "4803c71e6b1833ca72b8b26ef2ecd5adc8a38031",  "old_path":  "package.json",  "new_path":  "package.json",  "position_type":  "text",  "old_line":  27,  "new_line":  27  },  "resolvable":  false  }  ]  }  ] 
```

```
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/commits/11/discussions" 
```

### Get single commit discussion item[](#get-single-commit-discussion-item "Permalink")

返回特定项目提交的单个讨论项

```
GET /projects/:id/commits/:commit_id/discussions/:discussion_id 
```

Parameters:

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 项目的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `commit_id` | integer | yes | 提交的 ID |
| `discussion_id` | integer | yes | 讨论项目的 ID |

```
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/commits/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7" 
```

### Create new commit thread[](#create-new-commit-thread "Permalink")

为单个项目提交创建一个新线程. 这类似于创建便笺,但其他注释(回复)可以在以后添加.

```
POST /projects/:id/commits/:commit_id/discussions 
```

Parameters:

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 项目的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `commit_id` | integer | yes | 提交的 ID |
| `body` | string | yes | 线程的内容 |
| `created_at` | string | no | 日期时间字符串,ISO 8601 格式,例如 2016-03-11T03:45:40Z(需要管理员或项目/组所有者权限) |
| `position` | hash | no | 创建差异注释时的位置 |
| `position[base_sha]` | string | yes | 源分支中的基本提交 SHA |
| `position[start_sha]` | string | yes | SHA 引用目标分支中的提交 |
| `position[head_sha]` | string | yes | SHA 引用此提交的 HEAD |
| `position[position_type]` | string | yes | 位置参考的类型",允许的值:"文本"或"图像" |
| `position[new_path]` | string | no | 更改后的文件路径 |
| `position[new_line]` | integer | no | 变更后的行号 |
| `position[old_path]` | string | no | 更改前的文件路径 |
| `position[old_line]` | integer | no | 更改前的行号 |
| `position[width]` | integer | no | 图片宽度(用于"图片"差异注释) |
| `position[height]` | integer | no | 图片的高度(用于"图片"差异注释) |
| `position[x]` | integer | no | X 坐标(用于"图像"差异注释) |
| `position[y]` | integer | no | Y 坐标(用于"图像"差异注释) |

```
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/commits/11/discussions?body=comment" 
```

### Add note to existing commit thread[](#add-note-to-existing-commit-thread "Permalink")

向该线程添加新注释.

```
POST /projects/:id/commits/:commit_id/discussions/:discussion_id/notes 
```

Parameters:

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 项目的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `commit_id` | integer | yes | 提交的 ID |
| `discussion_id` | integer | yes | 线程的 ID |
| `note_id` | integer | yes | 线程注释的 ID |
| `body` | string | yes | 备注/回复的内容 |
| `created_at` | string | no | 日期时间字符串,ISO 8601 格式,例如 2016-03-11T03:45:40Z(需要管理员或项目/组所有者权限) |

```
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/commits/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7/notes?body=comment 
```

### Modify an existing commit thread note[](#modify-an-existing-commit-thread-note "Permalink")

修改或解决提交的现有线程注释.

```
PUT /projects/:id/commits/:commit_id/discussions/:discussion_id/notes/:note_id 
```

Parameters:

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 项目的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `commit_id` | integer | yes | 提交的 ID |
| `discussion_id` | integer | yes | 线程的 ID |
| `note_id` | integer | yes | 线程注释的 ID |
| `body` | string | no | 笔记内容 |

```
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/commits/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7/notes/1108?body=comment" 
```

解决注释:

```
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/commits/11/discussions/6a9c1750b37d513a43987b574953fceb50b03ce7/notes/1108?resolved=true" 
```

### Delete a commit thread note[](#delete-a-commit-thread-note "Permalink")

删除提交的现有线程注释.

```
DELETE /projects/:id/commits/:commit_id/discussions/:discussion_id/notes/:note_id 
```

Parameters:

| Attribute | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | integer/string | yes | 项目的 ID 或[URL 编码的路径](README.html#namespaced-path-encoding) |
| `commit_id` | integer | yes | 提交的 ID |
| `discussion_id` | integer | yes | 线程的 ID |
| `note_id` | integer | yes | 线程注释的 ID |

```
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/commits/11/discussions/636" 
```