From bd9b62114f77e024390c2dc0af4325c76e740a71 Mon Sep 17 00:00:00 2001 From: James Lopez Date: Wed, 5 Jul 2017 16:50:53 +0200 Subject: add API documentation --- doc/api/issues.md | 25 +++++++++++++++++++++++++ doc/api/snippets.md | 24 ++++++++++++++++++++++++ 2 files changed, 49 insertions(+) (limited to 'doc') diff --git a/doc/api/issues.md b/doc/api/issues.md index df5666bb7b6..befcc80de26 100644 --- a/doc/api/issues.md +++ b/doc/api/issues.md @@ -964,3 +964,28 @@ Example response: ## Comments on issues Comments are done via the [notes](notes.md) resource. + +## Get user agent details + +``` +GET /projects/:id/issues/:issue_iid/user_agent_detail +``` + +| Attribute | Type | Required | Description | +|-------------|---------|----------|--------------------------------------| +| `id` | integer/string | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user | +| `issue_iid` | integer | yes | The internal ID of a project's issue | + +```bash +curl --request GET --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/projects/5/issues/93/user_agent_detail +``` + +Example response: + +```json +{ + "user_agent": "AppleWebKit/537.36", + "ip_address": "127.0.0.1", + "submitted": false, +} +``` diff --git a/doc/api/snippets.md b/doc/api/snippets.md index efaab712367..7be6cb3da2d 100644 --- a/doc/api/snippets.md +++ b/doc/api/snippets.md @@ -234,3 +234,27 @@ Example response: } ] ``` + +## Get user agent details + +``` +GET /snippets/:id/user_agent_detail +``` + +| Attribute | Type | Required | Description | +|-------------|---------|----------|--------------------------------------| +| `id` | Integer | yes | The ID of a snippet | + +```bash +curl --request GET --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/snippets/1/user_agent_detail +``` + +Example response: + +```json +{ + "user_agent": "AppleWebKit/537.36", + "ip_address": "127.0.0.1", + "submitted": false, +} +``` -- cgit v1.2.1 From 47e17fe12ad009656f0b20469f930d1aa0e742e6 Mon Sep 17 00:00:00 2001 From: James Lopez Date: Thu, 6 Jul 2017 11:48:19 +0200 Subject: fix docs --- doc/api/issues.md | 4 +++- doc/api/snippets.md | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/api/issues.md b/doc/api/issues.md index befcc80de26..067934bd480 100644 --- a/doc/api/issues.md +++ b/doc/api/issues.md @@ -967,6 +967,8 @@ Comments are done via the [notes](notes.md) resource. ## Get user agent details +Available only for admins. + ``` GET /projects/:id/issues/:issue_iid/user_agent_detail ``` @@ -986,6 +988,6 @@ Example response: { "user_agent": "AppleWebKit/537.36", "ip_address": "127.0.0.1", - "submitted": false, + "submitted": false } ``` diff --git a/doc/api/snippets.md b/doc/api/snippets.md index 7be6cb3da2d..39d099f0470 100644 --- a/doc/api/snippets.md +++ b/doc/api/snippets.md @@ -237,6 +237,8 @@ Example response: ## Get user agent details +Available only for admins. + ``` GET /snippets/:id/user_agent_detail ``` @@ -255,6 +257,6 @@ Example response: { "user_agent": "AppleWebKit/537.36", "ip_address": "127.0.0.1", - "submitted": false, + "submitted": false } ``` -- cgit v1.2.1 From 2aa95aa0185c94aefd6e51a35c62650d75d3c8b6 Mon Sep 17 00:00:00 2001 From: James Lopez Date: Thu, 6 Jul 2017 15:19:14 +0200 Subject: refactor code based on feedback --- doc/api/issues.md | 2 +- doc/api/snippets.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/api/issues.md b/doc/api/issues.md index 067934bd480..a00a63bad4b 100644 --- a/doc/api/issues.md +++ b/doc/api/issues.md @@ -988,6 +988,6 @@ Example response: { "user_agent": "AppleWebKit/537.36", "ip_address": "127.0.0.1", - "submitted": false + "akismet_submitted": false } ``` diff --git a/doc/api/snippets.md b/doc/api/snippets.md index 39d099f0470..ea66aa552a7 100644 --- a/doc/api/snippets.md +++ b/doc/api/snippets.md @@ -257,6 +257,6 @@ Example response: { "user_agent": "AppleWebKit/537.36", "ip_address": "127.0.0.1", - "submitted": false + "akismet_submitted": false } ``` -- cgit v1.2.1 From 5173955fd49ab9748a9878203b691732198091aa Mon Sep 17 00:00:00 2001 From: James Lopez Date: Fri, 7 Jul 2017 15:18:01 +0200 Subject: update docs --- doc/api/project_snippets.md | 31 +++++++++++++++++++++++++++++++ doc/api/snippets.md | 5 +++++ 2 files changed, 36 insertions(+) (limited to 'doc') diff --git a/doc/api/project_snippets.md b/doc/api/project_snippets.md index 92491de4daa..cd64631ca4f 100644 --- a/doc/api/project_snippets.md +++ b/doc/api/project_snippets.md @@ -119,3 +119,34 @@ Parameters: - `id` (required) - The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user - `snippet_id` (required) - The ID of a project's snippet + +## Get user agent details + +> **Notes:** +> [Introduced][ce-29508] in GitLab 9.4. + + +Available only for admins. + +``` +GET /projects/:id/snippets/:snippet_id/user_agent_detail +``` + +| Attribute | Type | Required | Description | +|-------------|---------|----------|--------------------------------------| +| `id` | Integer | yes | The ID of a snippet | + +```bash +curl --request GET --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v4/projects/1/snippets/1/user_agent_detail +``` + +Example response: + +```json +{ + "user_agent": "AppleWebKit/537.36", + "ip_address": "127.0.0.1", + "akismet_submitted": false +} +``` +[ce-[ce-29508]: https://gitlab.com/gitlab-org/gitlab-ce/issues/29508]: https://gitlab.com/gitlab-org/gitlab-ce/issues/29508 diff --git a/doc/api/snippets.md b/doc/api/snippets.md index ea66aa552a7..798b80a5b11 100644 --- a/doc/api/snippets.md +++ b/doc/api/snippets.md @@ -237,6 +237,10 @@ Example response: ## Get user agent details +> **Notes:** +> [Introduced][ce-29508] in GitLab 9.4. + + Available only for admins. ``` @@ -260,3 +264,4 @@ Example response: "akismet_submitted": false } ``` +[ce-[ce-29508]: https://gitlab.com/gitlab-org/gitlab-ce/issues/29508]: https://gitlab.com/gitlab-org/gitlab-ce/issues/29508 -- cgit v1.2.1 From a9e8af3386f47cee657a95f0094095f5f4cc1b4e Mon Sep 17 00:00:00 2001 From: James Lopez Date: Fri, 7 Jul 2017 15:54:39 +0200 Subject: add spec and project snippet user agent details endpoint --- doc/api/project_snippets.md | 1 + doc/api/snippets.md | 1 + 2 files changed, 2 insertions(+) (limited to 'doc') diff --git a/doc/api/project_snippets.md b/doc/api/project_snippets.md index cd64631ca4f..d74398c6e65 100644 --- a/doc/api/project_snippets.md +++ b/doc/api/project_snippets.md @@ -149,4 +149,5 @@ Example response: "akismet_submitted": false } ``` + [ce-[ce-29508]: https://gitlab.com/gitlab-org/gitlab-ce/issues/29508]: https://gitlab.com/gitlab-org/gitlab-ce/issues/29508 diff --git a/doc/api/snippets.md b/doc/api/snippets.md index 798b80a5b11..fdafbfb5b9e 100644 --- a/doc/api/snippets.md +++ b/doc/api/snippets.md @@ -264,4 +264,5 @@ Example response: "akismet_submitted": false } ``` + [ce-[ce-29508]: https://gitlab.com/gitlab-org/gitlab-ce/issues/29508]: https://gitlab.com/gitlab-org/gitlab-ce/issues/29508 -- cgit v1.2.1