Commit 43d75960 authored by Sebastian Ziebell's avatar Sebastian Ziebell

Merge branch 'feature/api-documentation-fixes' of github.com:Xylakant/gitlabhq into fixes/api

Conflicts:
	doc/api/projects.md
parents 07f306d8 e76215a3
# GitLab API # GitLab API
All API requests require authentication. You need to pass a `private_token` parameter by url or header. You can find or reset your private token in your profile. 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: If no, or an invalid, `private_token` is provided then an error message will be returned with status code 401:
...@@ -18,6 +18,13 @@ Example of a valid API request: ...@@ -18,6 +18,13 @@ Example of a valid API request:
GET http://example.com/api/v3/projects?private_token=QVy1PB7sTxfy4pqfZM1U GET http://example.com/api/v3/projects?private_token=QVy1PB7sTxfy4pqfZM1U
``` ```
Example for a valid API request using curl and authentication via header:
```
curl --header "PRIVATE-TOKEN: QVy1PB7sTxfy4pqfZM1U" "http://example.com/api/v3/projects"
```
The API uses JSON to serialize data. You don't need to specify `.json` at the end of API URL. The API uses JSON to serialize data. You don't need to specify `.json` at the end of API URL.
#### Pagination #### Pagination
......
...@@ -65,7 +65,8 @@ Return values: ...@@ -65,7 +65,8 @@ Return values:
### Get single project ### Get single project
Get a specific project, identified by project ID, which is owned by the authentication user. Get a specific project, identified by project ID or NAME, which is owned by the authentication user.
Currently namespaced projects cannot retrieved by name.
``` ```
GET /projects/:id GET /projects/:id
...@@ -73,7 +74,7 @@ GET /projects/:id ...@@ -73,7 +74,7 @@ GET /projects/:id
Parameters: Parameters:
+ `id` (required) - The ID of a project + `id` (required) - The ID or NAME of a project
```json ```json
{ {
...@@ -132,7 +133,20 @@ Return values: ...@@ -132,7 +133,20 @@ Return values:
+ `404 Not Found` if something else fails + `404 Not Found` if something else fails
### List project members ## Project access levels
The project access levels are defined in the `user_project` class. Currently, 4
levels are recoginized:
```
GUEST = 10
REPORTER = 20
DEVELOPER = 30
MASTER = 40
```
## List project team members
Get a list of project team members. Get a list of project team members.
...@@ -142,7 +156,7 @@ GET /projects/:id/members ...@@ -142,7 +156,7 @@ GET /projects/:id/members
Parameters: Parameters:
+ `id` (required) - The ID of a project + `id` (required) - The ID or NAME of a project
+ `query` - Query string + `query` - Query string
Return Values: Return Values:
...@@ -163,7 +177,7 @@ GET /projects/:id/members/:user_id ...@@ -163,7 +177,7 @@ GET /projects/:id/members/:user_id
Parameters: Parameters:
+ `id` (required) - The ID of a project + `id` (required) - The ID or NAME of a project
+ `user_id` (required) - The ID of a user + `user_id` (required) - The ID of a user
```json ```json
...@@ -196,7 +210,7 @@ POST /projects/:id/members ...@@ -196,7 +210,7 @@ POST /projects/:id/members
Parameters: Parameters:
+ `id` (required) - The ID of a project + `id` (required) - The ID or NAME of a project
+ `user_id` (required) - The ID of a user to add + `user_id` (required) - The ID of a user to add
+ `access_level` (required) - Project access level + `access_level` (required) - Project access level
...@@ -219,7 +233,7 @@ PUT /projects/:id/members/:user_id ...@@ -219,7 +233,7 @@ PUT /projects/:id/members/:user_id
Parameters: Parameters:
+ `id` (required) - The ID of a project + `id` (required) - The ID or NAME of a project
+ `user_id` (required) - The ID of a team member + `user_id` (required) - The ID of a team member
+ `access_level` (required) - Project access level + `access_level` (required) - Project access level
...@@ -242,7 +256,7 @@ DELETE /projects/:id/members/:user_id ...@@ -242,7 +256,7 @@ DELETE /projects/:id/members/:user_id
Parameters: Parameters:
+ `id` (required) - The ID of a project + `id` (required) - The ID or NAME of a project
+ `user_id` (required) - The ID of a team member + `user_id` (required) - The ID of a team member
Return Values: Return Values:
...@@ -269,7 +283,7 @@ GET /projects/:id/hooks ...@@ -269,7 +283,7 @@ GET /projects/:id/hooks
Parameters: Parameters:
+ `id` (required) - The ID of a project + `id` (required) - The ID or NAME of a project
Return values: Return values:
...@@ -288,7 +302,7 @@ GET /projects/:id/hooks/:hook_id ...@@ -288,7 +302,7 @@ GET /projects/:id/hooks/:hook_id
Parameters: Parameters:
+ `id` (required) - The ID of a project + `id` (required) - The ID or NAME of a project
+ `hook_id` (required) - The ID of a project hook + `hook_id` (required) - The ID of a project hook
```json ```json
...@@ -315,7 +329,7 @@ POST /projects/:id/hooks ...@@ -315,7 +329,7 @@ POST /projects/:id/hooks
Parameters: Parameters:
+ `id` (required) - The ID of a project + `id` (required) - The ID or NAME of a project
+ `url` (required) - The hook URL + `url` (required) - The hook URL
Return values: Return values:
...@@ -336,7 +350,7 @@ PUT /projects/:id/hooks/:hook_id ...@@ -336,7 +350,7 @@ PUT /projects/:id/hooks/:hook_id
Parameters: Parameters:
+ `id` (required) - The ID of a project + `id` (required) - The ID or NAME of a project
+ `hook_id` (required) - The ID of a project hook + `hook_id` (required) - The ID of a project hook
+ `url` (required) - The hook URL + `url` (required) - The hook URL
...@@ -359,7 +373,7 @@ DELETE /projects/:id/hooks/:hook_id ...@@ -359,7 +373,7 @@ DELETE /projects/:id/hooks/:hook_id
Parameters: Parameters:
+ `id` (required) - The ID of a project + `id` (required) - The ID or NAME of a project
+ `hook_id` (required) - The ID of hook to delete + `hook_id` (required) - The ID of hook to delete
Return values: Return values:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment