From 5d1b616eba6040a9a51fee057c2edc24a5be9832 Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Mon, 19 Sep 2016 12:49:12 +0100 Subject: Update API documentation to mention rails session cookies [ci skip] --- doc/api/README.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'doc/api/README.md') diff --git a/doc/api/README.md b/doc/api/README.md index 7661e1eea02..6e3295e0e0c 100644 --- a/doc/api/README.md +++ b/doc/api/README.md @@ -55,11 +55,12 @@ The following documentation is for the [internal CI API](ci/README.md): ## Authentication -All API requests require authentication via a token. There are three types of tokens -available: private tokens, OAuth 2 tokens, and personal access tokens. +All API requests require authentication via a session cookie or token. There are +three types of tokens available: private tokens, OAuth 2 tokens, and personal +access tokens. -If a token is invalid or omitted, an error message will be returned with -status code `401`: +If authentication information is invalid or omitted, an error message will be +returned with status code `401`: ```json { @@ -98,6 +99,13 @@ that needs access to the GitLab API. Once you have your token, pass it to the API using either the `private_token` parameter or the `PRIVATE-TOKEN` header. + +### Session cookie + +When signing in to GitLab as an ordinary user, a `_gitlab_session` cookie is +set. The API will use this cookie for authentication if it is present, but using +the API to generate a new session cookie is currently not supported. + ## Basic Usage API requests should be prefixed with `api` and the API version. The API version -- cgit v1.2.1 From a3d3240d0f4b4831b171a452de67142b99bee927 Mon Sep 17 00:00:00 2001 From: "Z.J. van de Weg" Date: Fri, 23 Sep 2016 15:38:57 +0300 Subject: Add link to broadcast messages docs Fixes #22508 [ci skip] --- doc/api/README.md | 1 + 1 file changed, 1 insertion(+) (limited to 'doc/api/README.md') diff --git a/doc/api/README.md b/doc/api/README.md index 6e3295e0e0c..8e4f7f12b4b 100644 --- a/doc/api/README.md +++ b/doc/api/README.md @@ -10,6 +10,7 @@ following locations: - [Award Emoji](award_emoji.md) - [Branches](branches.md) +- [Broadcast Messages](broadcast_messages.md) - [Builds](builds.md) - [Build Triggers](build_triggers.md) - [Build Variables](build_variables.md) -- cgit v1.2.1 From 6f1d243b998bfba6beedd0f7f6ff6ddb976a18c8 Mon Sep 17 00:00:00 2001 From: Alan Moore Date: Thu, 29 Sep 2016 05:07:17 +0000 Subject: Fixed Session Cookie header --- doc/api/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/api/README.md') diff --git a/doc/api/README.md b/doc/api/README.md index 8e4f7f12b4b..bbd5bcfb386 100644 --- a/doc/api/README.md +++ b/doc/api/README.md @@ -101,7 +101,7 @@ Once you have your token, pass it to the API using either the `private_token` parameter or the `PRIVATE-TOKEN` header. -### Session cookie +### Session Cookie When signing in to GitLab as an ordinary user, a `_gitlab_session` cookie is set. The API will use this cookie for authentication if it is present, but using -- cgit v1.2.1 From fdfc93679d1ca91d4666095ba2ca732fdb273947 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 7 Oct 2016 18:39:04 +0300 Subject: Fix API specs behaviour for invalid routing Signed-off-by: Dmitriy Zaporozhets --- doc/api/README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'doc/api/README.md') diff --git a/doc/api/README.md b/doc/api/README.md index bbd5bcfb386..8004a00659c 100644 --- a/doc/api/README.md +++ b/doc/api/README.md @@ -355,6 +355,19 @@ follows: } ``` +## Bad request + +When you try to access API URL that does not exist you will receive 400 Bad Request. + +``` +HTTP/1.1 400 Bad Request +Content-Type: application/json +{ + "error": "400 Bad Request" +} +``` + + ## Clients There are many unofficial GitLab API Clients for most of the popular -- cgit v1.2.1 From 137ebcfb3cb013174f2885776a47264cffd193a6 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 7 Oct 2016 20:18:02 +0300 Subject: Replace undefined Grape routing code from 400 to 404 Signed-off-by: Dmitriy Zaporozhets --- doc/api/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'doc/api/README.md') diff --git a/doc/api/README.md b/doc/api/README.md index 8004a00659c..d47e537debc 100644 --- a/doc/api/README.md +++ b/doc/api/README.md @@ -357,13 +357,13 @@ follows: ## Bad request -When you try to access API URL that does not exist you will receive 400 Bad Request. +When you try to access API URL that does not exist you will receive 404 Not Found. ``` -HTTP/1.1 400 Bad Request +HTTP/1.1 404 Not Found Content-Type: application/json { - "error": "400 Bad Request" + "error": "404 Not Found" } ``` -- cgit v1.2.1 From dc37ef6139ba96fe0b90f7c0188161b298269fef Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 10 Oct 2016 16:04:05 +0300 Subject: Better wording in API readme Signed-off-by: Dmitriy Zaporozhets --- doc/api/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/api/README.md') diff --git a/doc/api/README.md b/doc/api/README.md index d47e537debc..9e907689c80 100644 --- a/doc/api/README.md +++ b/doc/api/README.md @@ -355,9 +355,9 @@ follows: } ``` -## Bad request +## Unknown route -When you try to access API URL that does not exist you will receive 404 Not Found. +When you try to access an API URL that does not exist you will receive 404 Not Found. ``` HTTP/1.1 404 Not Found -- cgit v1.2.1 From b9b13ea8016077e186374e4ee45dfc8a59ea5a78 Mon Sep 17 00:00:00 2001 From: Thomas Balthazar Date: Mon, 8 Aug 2016 13:42:24 +0200 Subject: Create a new /templates API namespace The /licenses, /gitignores and /gitlab_ci_ymls endpoints are now also available under a new /templates namespace. Old endpoints will be deprecated when GitLab 9.0.0 is released. --- doc/api/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'doc/api/README.md') diff --git a/doc/api/README.md b/doc/api/README.md index 9e907689c80..00cb003ed8a 100644 --- a/doc/api/README.md +++ b/doc/api/README.md @@ -17,6 +17,8 @@ following locations: - [Commits](commits.md) - [Deployments](deployments.md) - [Deploy Keys](deploy_keys.md) +- [Gitignores templates](templates/gitignores.md) +- [GitLab CI Config templates](templates/gitlab_ci_ymls.md) - [Groups](groups.md) - [Group Access Requests](access_requests.md) - [Group Members](members.md) @@ -25,7 +27,7 @@ following locations: - [Labels](labels.md) - [Merge Requests](merge_requests.md) - [Milestones](milestones.md) -- [Open source license templates](licenses.md) +- [Open source license templates](templates/licenses.md) - [Namespaces](namespaces.md) - [Notes](notes.md) (comments) - [Notification settings](notification_settings.md) -- cgit v1.2.1 From b998479c81512b7c9a2cff28e7aabff3c4be0424 Mon Sep 17 00:00:00 2001 From: Robert Schilling Date: Wed, 12 Oct 2016 13:32:48 +0200 Subject: API: Version information --- doc/api/README.md | 1 + 1 file changed, 1 insertion(+) (limited to 'doc/api/README.md') diff --git a/doc/api/README.md b/doc/api/README.md index 9e907689c80..75b098f2eeb 100644 --- a/doc/api/README.md +++ b/doc/api/README.md @@ -46,6 +46,7 @@ following locations: - [Todos](todos.md) - [Users](users.md) - [Validate CI configuration](ci/lint.md) +- [Version](version.md) ### Internal CI API -- cgit v1.2.1 From 872d537eb389f0e0573490b77d03b3a6d4d1beb4 Mon Sep 17 00:00:00 2001 From: Achilleas Pipinellis Date: Tue, 1 Nov 2016 13:07:53 +0100 Subject: Add a link to the Issue Boards API in main README [ci skip] --- doc/api/README.md | 1 + 1 file changed, 1 insertion(+) (limited to 'doc/api/README.md') diff --git a/doc/api/README.md b/doc/api/README.md index 3fbe5197a21..f65b934b9db 100644 --- a/doc/api/README.md +++ b/doc/api/README.md @@ -23,6 +23,7 @@ following locations: - [Group Access Requests](access_requests.md) - [Group Members](members.md) - [Issues](issues.md) +- [Issue Boards](boards.md) - [Keys](keys.md) - [Labels](labels.md) - [Merge Requests](merge_requests.md) -- cgit v1.2.1