summaryrefslogtreecommitdiff
path: root/doc/api
diff options
context:
space:
mode:
authorFranz-Robert van Vugt <f.vanvugt@zeno.nu>2014-03-27 21:40:33 +0100
committerFranz-Robert van Vugt <f.vanvugt@zeno.nu>2014-03-27 21:40:33 +0100
commitcfc4a2dbe3652180c1d08d5d9e154e28cbb340fb (patch)
treef9af595878a2789be45c612e26ced8c9f7c592ad /doc/api
parentf03820ebf2f28ddb26e422322219a815d8cd3749 (diff)
parentfc5ac1451dcfda7cf53d536db79b552b29849276 (diff)
downloadgitlab-ce-cfc4a2dbe3652180c1d08d5d9e154e28cbb340fb.tar.gz
Merge branch 'master' of https://github.com/gitlabhq/gitlabhq into patch-1
Diffstat (limited to 'doc/api')
-rw-r--r--doc/api/README.md53
-rw-r--r--doc/api/merge_requests.md42
-rw-r--r--doc/api/projects.md26
-rw-r--r--doc/api/system_hooks.md140
4 files changed, 164 insertions, 97 deletions
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
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"
+ }
+ }
+]
+```
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"
+ }
+]
+```
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