2019-02-15 15:39:39 +05:30
|
|
|
# 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.
|
|
|
|
|
2020-04-08 14:13:33 +05:30
|
|
|
```plaintext
|
2019-02-15 15:39:39 +05:30
|
|
|
PUT /suggestions/:id/apply
|
|
|
|
```
|
|
|
|
|
|
|
|
| Attribute | Type | Required | Description |
|
|
|
|
| --------- | ---- | -------- | ----------- |
|
|
|
|
| `id` | integer/string | yes | The ID of a suggestion |
|
|
|
|
|
2020-03-13 15:44:24 +05:30
|
|
|
```shell
|
2020-06-23 00:09:42 +05:30
|
|
|
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/suggestions/5/apply"
|
2019-02-15 15:39:39 +05:30
|
|
|
```
|
|
|
|
|
|
|
|
Example response:
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"id": 36,
|
|
|
|
"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"
|
|
|
|
}
|
|
|
|
```
|