From 901976d9729fe5fb91929c463b0ad3a68e457c82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ho=CC=88ltje?= Date: Fri, 14 Mar 2014 14:53:43 -0400 Subject: Switched line endings to LF for system_hooks.md It was checked in with Windows style line endings. --- doc/api/system_hooks.md | 140 ++++++++++++++++++++++++------------------------ 1 file changed, 70 insertions(+), 70 deletions(-) (limited to 'doc/api') diff --git a/doc/api/system_hooks.md b/doc/api/system_hooks.md index 355ce31c126..2e87ada1d70 100644 --- a/doc/api/system_hooks.md +++ b/doc/api/system_hooks.md @@ -1,70 +1,70 @@ -All methods require admin authorization. - -The url endpoint of the system hooks can be configured in [the admin area under hooks](/admin/hooks). - -## List system hooks - -Get list of system hooks - -``` -GET /hooks -``` - -Parameters: - -+ **none** - -```json -[ - { - "id":3, - "url":"http://example.com/hook", - "created_at":"2013-10-02T10:15:31Z" - } -] -``` - -## Add new system hook hook - -``` -POST /hooks -``` - -Parameters: - -+ `url` (required) - The hook URL - - -## Test system hook - -``` -GET /hooks/:id -``` - -Parameters: - -+ `id` (required) - The ID of hook - -```json -{ - "event_name":"project_create", - "name":"Ruby", - "path":"ruby", - "project_id":1, - "owner_name":"Someone", - "owner_email":"example@gitlabhq.com" -} -``` - -## Delete system hook - -Deletes a system hook. This is an idempotent API function and returns `200 Ok` even if the hook -is not available. If the hook is deleted it is also returned as JSON. - -``` -DELETE /hooks/:id -``` - -Parameters: - -+ `id` (required) - The ID of hook +All methods require admin authorization. + +The url endpoint of the system hooks can be configured in [the admin area under hooks](/admin/hooks). + +## List system hooks + +Get list of system hooks + +``` +GET /hooks +``` + +Parameters: + ++ **none** + +```json +[ + { + "id":3, + "url":"http://example.com/hook", + "created_at":"2013-10-02T10:15:31Z" + } +] +``` + +## Add new system hook hook + +``` +POST /hooks +``` + +Parameters: + ++ `url` (required) - The hook URL + + +## Test system hook + +``` +GET /hooks/:id +``` + +Parameters: + ++ `id` (required) - The ID of hook + +```json +{ + "event_name":"project_create", + "name":"Ruby", + "path":"ruby", + "project_id":1, + "owner_name":"Someone", + "owner_email":"example@gitlabhq.com" +} +``` + +## Delete system hook + +Deletes a system hook. This is an idempotent API function and returns `200 Ok` even if the hook +is not available. If the hook is deleted it is also returned as JSON. + +``` +DELETE /hooks/:id +``` + +Parameters: + ++ `id` (required) - The ID of hook -- cgit v1.2.1 From 9886998f24b3d6e44aafc412b87980cb1755544c Mon Sep 17 00:00:00 2001 From: Stuart Pook Date: Wed, 19 Mar 2014 19:07:51 +0100 Subject: Add method to get the comments on a merge request Add method to get the comments for a merge request and document that you can change the status of a merge request. --- doc/api/merge_requests.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'doc/api') diff --git a/doc/api/merge_requests.md b/doc/api/merge_requests.md index 2ddaea5a584..3ce0fb84917 100644 --- a/doc/api/merge_requests.md +++ b/doc/api/merge_requests.md @@ -150,6 +150,7 @@ Parameters: + `target_branch` - The target branch + `assignee_id` - Assignee user ID + `title` - Title of MR ++ `state_event` - New state (close|reopen|merge) ```json @@ -210,3 +211,44 @@ Parameters: "note":"text1" } ``` + + +## Get the comments on a MR + +Gets all the comments associated with a merge request. + +``` +GET /projects/:id/merge_request/:merge_request_id/comments +``` + +Parameters: + ++ `id` (required) - The ID of a project ++ `merge_request_id` (required) - ID of merge request + +```json +[ + { + "note":"this is the 1st comment on the 2merge merge request", + "author":{ + "id":11, + "username":"admin", + "email":"admin@local.host", + "name":"Administrator", + "state":"active", + "created_at":"2014-03-06T08:17:35.000Z" + } + }, + { + "note":"_Status changed to closed_", + "author":{ + "id":11, + "username":"admin", + "email":"admin@local.host", + "name":"Administrator", + "state":"active", + "created_at":"2014-03-06T08:17:35.000Z" + } + } +] +``` -- cgit v1.2.1 From 19938156d89ea980596fd5b1d72856f3defb228a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81bner=20Silva=20de=20Oliveira?= Date: Sun, 23 Mar 2014 19:20:17 -0300 Subject: documentation for api method which get labels of a project --- doc/api/projects.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'doc/api') diff --git a/doc/api/projects.md b/doc/api/projects.md index 6e82ddd9903..54618d7c045 100644 --- a/doc/api/projects.md +++ b/doc/api/projects.md @@ -621,3 +621,29 @@ Parameters: + query (required) - A string contained in the project name + per_page (optional) - number of projects to return per page + page (optional) - the page to retrieve + + +## Labels + +### List project labels + +Get a list of project labels. + +``` +GET /projects/:id/labels +``` + +Parameters: + ++ `id` (required) - The ID or NAMESPACE/PROJECT_NAME of a project + +```json +[ + { + "name":"featute" + }, + { + "name": "bug" + } +] +``` -- cgit v1.2.1 From b04c343311dfd5f12815936384762a9f1412fe34 Mon Sep 17 00:00:00 2001 From: dosire Date: Thu, 27 Mar 2014 10:53:26 +0100 Subject: Put important information at the top of the readme. --- doc/api/README.md | 53 ++++++++++++++++++++++++++--------------------------- 1 file changed, 26 insertions(+), 27 deletions(-) (limited to 'doc/api') diff --git a/doc/api/README.md b/doc/api/README.md index 850666953a3..fa5b12af14c 100644 --- a/doc/api/README.md +++ b/doc/api/README.md @@ -1,5 +1,31 @@ # GitLab API +## End-points + ++ [Users](users.md) ++ [Session](session.md) ++ [Projects](projects.md) ++ [Project Snippets](project_snippets.md) ++ [Repositories](repositories.md) ++ [Repository Files](repository_files.md) ++ [Commits](commits.md) ++ [Merge Requests](merge_requests.md) ++ [Issues](issues.md) ++ [Milestones](milestones.md) ++ [Notes](notes.md) ++ [Deploy Keys](deploy_keys.md) ++ [System Hooks](system_hooks.md) ++ [Groups](groups.md) + +## Clients + ++ [php-gitlab-api](https://github.com/m4tthumphrey/php-gitlab-api) - PHP ++ [Ruby Wrapper](https://github.com/NARKOZ/gitlab) - Ruby ++ [python-gitlab](https://github.com/Itxaka/python-gitlab) - Python ++ [java-gitlab-api](https://github.com/timols/java-gitlab-api) - Java + +## Introduction + All API requests require authentication. You need to pass a `private_token` parameter by url or header. If passed as header, the header name must be "PRIVATE-TOKEN" (capital and with dash instead of underscore). You can find or reset your private token in your profile. If no, or an invalid, `private_token` is provided then an error message will be returned with status code 401: @@ -117,30 +143,3 @@ Issue So if you want to get issue with api you use `http://host/api/v3/.../issues/:id.json` But when you want to create a link to web page - use `http:://host/project/issues/:iid.json` - - - -## Contents - -+ [Users](users.md) -+ [Session](session.md) -+ [Projects](projects.md) -+ [Project Snippets](project_snippets.md) -+ [Repositories](repositories.md) -+ [Repository Files](repository_files.md) -+ [Commits](commits.md) -+ [Merge Requests](merge_requests.md) -+ [Issues](issues.md) -+ [Milestones](milestones.md) -+ [Notes](notes.md) -+ [Deploy Keys](deploy_keys.md) -+ [System Hooks](system_hooks.md) -+ [Groups](groups.md) - - -## Clients - -+ [php-gitlab-api](https://github.com/m4tthumphrey/php-gitlab-api) - PHP -+ [Ruby Wrapper](https://github.com/NARKOZ/gitlab) - Ruby -+ [python-gitlab](https://github.com/Itxaka/python-gitlab) - Python -+ [java-gitlab-api](https://github.com/timols/java-gitlab-api) - Java -- cgit v1.2.1