diff options
author | Jacques Erasmus <jerasmus@gitlab.com> | 2018-12-18 08:59:50 +0000 |
---|---|---|
committer | Achilleas Pipinellis <axil@gitlab.com> | 2018-12-18 08:59:50 +0000 |
commit | 862c5635bc12f6c64f56a517fd1473c3c0acf133 (patch) | |
tree | abb1fd29c1ed5bc6b2aeb11ec16009f79e57d982 /doc/api/suggestions.md | |
parent | aa343d546c529c571e6c156366b62d2f721fe92e (diff) | |
download | gitlab-ce-862c5635bc12f6c64f56a517fd1473c3c0acf133.tar.gz |
Suggest diff line change documentation
Diffstat (limited to 'doc/api/suggestions.md')
-rw-r--r-- | doc/api/suggestions.md | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/doc/api/suggestions.md b/doc/api/suggestions.md new file mode 100644 index 00000000000..9d76ef0c4bf --- /dev/null +++ b/doc/api/suggestions.md @@ -0,0 +1,36 @@ +# Suggest Changes API + +Every API call to suggestions must be authenticated. + +## Applying suggestions + +Applies a suggested patch in a merge request. Users must be +at least [Developer](../user/permissions.md) to perform such action. + +``` +PUT /suggestions/:id/apply +``` + +| Attribute | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `id` | integer/string | yes | The ID of a suggestion | + +```bash +curl --request PUT --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/suggestions/5/apply +``` + +Example response: + +```json + { + "id": 36, + "from_original_line": 10, + "to_original_line": 10, + "from_line": 10, + "to_line": 10, + "appliable": false, + "applied": true, + "from_content": " \"--talk-name=org.freedesktop.\",\n", + "to_content": " \"--talk-name=org.free.\",\n \"--talk-name=org.desktop.\",\n" + } +``` |