diff options
| author | Robert Schilling <rschilling@student.tugraz.at> | 2016-04-08 14:17:42 +0200 |
|---|---|---|
| committer | Robert Schilling <rschilling@student.tugraz.at> | 2016-04-13 13:45:00 +0200 |
| commit | bd0be13f5b52b8eaee019d722980b29acbc55b05 (patch) | |
| tree | 44c9dee41f377a46fded808aa1a3332d7ccf39e7 /doc/api | |
| parent | 861e685e1853d45dea83bc1d06ebd639b120f36c (diff) | |
| download | gitlab-ce-bd0be13f5b52b8eaee019d722980b29acbc55b05.tar.gz | |
API: Ability to subscribe and unsubscribe from an issue
Diffstat (limited to 'doc/api')
| -rw-r--r-- | doc/api/issues.md | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/doc/api/issues.md b/doc/api/issues.md index f09847aef95..4f7d948eba1 100644 --- a/doc/api/issues.md +++ b/doc/api/issues.md @@ -406,6 +406,114 @@ Example response: } ``` +## Subscribe to an issue + +Subscribes to an issue to receive notifications. If the operation is successful, +status code `201` together with the updated issue is returned. If the user is +already subscribed to the issue, the status code `304` is returned. If the +project or issue is not found, status code `404` is returned. + +``` +POST /projects/:id/issues/:issue_id/subscribe +``` + +| Attribute | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `id` | integer | yes | The ID of a project | +| `issue_id` | integer | yes | The ID of a project's issue | + +```bash +curl -X POST -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/5/issues/93/subscribe +``` + +Example response: + +```json +{ + "id": 92, + "iid": 11, + "project_id": 5, + "title": "Sit voluptas tempora quisquam aut doloribus et.", + "description": "Repellat voluptas quibusdam voluptatem exercitationem.", + "state": "opened", + "created_at": "2016-04-05T21:41:45.652Z", + "updated_at": "2016-04-07T12:20:17.596Z", + "labels": [], + "milestone": null, + "assignee": { + "name": "Miss Monserrate Beier", + "username": "axel.block", + "id": 12, + "state": "active", + "avatar_url": "http://www.gravatar.com/avatar/46f6f7dc858ada7be1853f7fb96e81da?s=80&d=identicon", + "web_url": "https://gitlab.example.com/u/axel.block" + }, + "author": { + "name": "Kris Steuber", + "username": "solon.cremin", + "id": 10, + "state": "active", + "avatar_url": "http://www.gravatar.com/avatar/7a190fecbaa68212a4b68aeb6e3acd10?s=80&d=identicon", + "web_url": "https://gitlab.example.com/u/solon.cremin" + } +} +``` + +## Unsubscribe from an issue + +Unsubscribes from an issue to not receive notifications from that issue. If the +operation is successful, status code `201` together with the updated issue is +returned. If the user is not subscribed to the issue, the status code `304` +is returned. If the project or issue is not found, status code `404` is +returned. + +``` +POST /projects/:id/issues/:issue_id/unsubscribe +``` + +| Attribute | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `id` | integer | yes | The ID of a project | +| `issue_id` | integer | yes | The ID of a project's issue | + +```bash +curl -X POST -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/5/issues/93/unsubscribe +``` + +Example response: + +```json +{ + "id": 93, + "iid": 12, + "project_id": 5, + "title": "Incidunt et rerum ea expedita iure quibusdam.", + "description": "Et cumque architecto sed aut ipsam.", + "state": "opened", + "created_at": "2016-04-05T21:41:45.217Z", + "updated_at": "2016-04-07T13:02:37.905Z", + "labels": [], + "milestone": null, + "assignee": { + "name": "Edwardo Grady", + "username": "keyon", + "id": 21, + "state": "active", + "avatar_url": "http://www.gravatar.com/avatar/3e6f06a86cf27fa8b56f3f74f7615987?s=80&d=identicon", + "web_url": "https://gitlab.example.com/u/keyon" + }, + "author": { + "name": "Vivian Hermann", + "username": "orville", + "id": 11, + "state": "active", + "avatar_url": "http://www.gravatar.com/avatar/5224fd70153710e92fb8bcf79ac29d67?s=80&d=identicon", + "web_url": "http://lgitlab.example.com/u/orville" + }, + "subscribed": false +} +``` + ## Comments on issues Comments are done via the [notes](notes.md) resource. |
