summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorTiago Botelho <tiagonbotelho@hotmail.com>2017-02-27 18:56:54 +0000
committerTiago Botelho <tiagonbotelho@hotmail.com>2017-03-01 13:11:11 +0000
commit2b474dc2b226460782413e634792cf83e791173b (patch)
treeaa4520aae3d0a1130a3349699a2e0c20f344aa39 /doc
parent9f2e4742e354f5548b4956060f1bfa5ee3bd6657 (diff)
downloadgitlab-ce-2b474dc2b226460782413e634792cf83e791173b.tar.gz
refactors finder and correlated code
Diffstat (limited to 'doc')
-rw-r--r--doc/api/personal_access_tokens.md24
-rw-r--r--doc/api/users.md43
2 files changed, 22 insertions, 45 deletions
diff --git a/doc/api/personal_access_tokens.md b/doc/api/personal_access_tokens.md
index 81e6f10f0c6..ea156d92dc8 100644
--- a/doc/api/personal_access_tokens.md
+++ b/doc/api/personal_access_tokens.md
@@ -2,11 +2,19 @@
## List
+This function takes pagination parameters `page` and `per_page` to restrict the list of personal access tokens.
+
```
GET /personal_access_tokens
```
-An example:
+Parameters:
+
+| Attribute | Type | Required | Description |
+| --------- | ---- | -------- | ----------- |
+| `state` | string | no | filter tokens based on state (all, active, inactive) |
+
+Example response:
```json
[
{
@@ -20,20 +28,6 @@ An example:
]
```
-In addition, you can filter tokens based on state: `all`, `active` and `inactive`
-
-```
-GET /personal_access_tokens?state=all
-```
-
-```
-GET /personal_access_tokens?state=active
-```
-
-```
-GET /personal_access_tokens?state=inactive
-```
-
## Show
```
diff --git a/doc/api/users.md b/doc/api/users.md
index 2b4099227bc..91168c05dbe 100644
--- a/doc/api/users.md
+++ b/doc/api/users.md
@@ -831,18 +831,21 @@ Example response:
## Retrieve user personal access tokens
It retrieves every personal access token of the user. Note that only administrators can do this.
+This function takes pagination parameters `page` and `per_page` to restrict the list of personal access tokens.
```
-GET /users/:user_id/personal_access_tokens
+GET /users/:id/personal_access_tokens
```
Parameters:
| Attribute | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
-| `user_id` | integer | yes | The ID of the user |
+| `id` | integer | yes | The ID of the user |
+| `state` | string | no | filter tokens based on state (all, active, inactive) |
+| `impersonation` | boolean | no | The impersonation flag of the personal access token |
-An example:
+Example response:
```json
[
{
@@ -852,45 +855,25 @@ An example:
"expires_at": "2017-01-04",
"scopes": ['api'],
"active": true,
- "impersonation": false,
+ "impersonation": true,
"token": "9koXpg98eAheJpvBs5tK"
}
]
```
-In addition, you can filter tokens based on state: `all`, `active` and `inactive`
-
-```
-GET /users/:user_id/personal_access_tokens?state=all
-```
-
-```
-GET /users/:user_id/personal_access_tokens?state=active
-```
-
-```
-GET /users/:user_id/personal_access_tokens?state=inactive
-```
-
-Finally, you can filter based on impersonation: `true` or `false`.
-
-```
-GET /users/:user_id/personal_access_tokens?impersonation=true
-```
-
## Show a user personal access token
It shows a user's personal access token. Note that only administrators can do this.
```
-GET /users/:user_id/personal_access_tokens/:personal_access_token_id
+GET /users/:id/personal_access_tokens/:personal_access_token_id
```
Parameters:
| Attribute | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
-| `user_id` | integer | yes | The ID of the user |
+| `id` | integer | yes | The ID of the user |
| `personal_access_token_id` | integer | yes | The ID of the personal access token |
## Create a personal access token
@@ -901,14 +884,14 @@ both API calls and Git reads and writes. The user will not see these tokens in h
settings page.
```
-POST /users/:user_id/personal_access_tokens
+POST /users/:id/personal_access_tokens
```
Parameters:
| Attribute | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
-| `user_id` | integer | yes | The ID of the user |
+| `id` | integer | yes | The ID of the user |
| `name` | string | yes | The name of the personal access token |
| `expires_at` | date | no | The expiration date of the personal access token |
| `scopes` | array | no | The array of scopes of the personal access token |
@@ -919,12 +902,12 @@ Parameters:
It revokes a personal access token. Note that only administrators can revoke impersonation tokens.
```
-DELETE /users/:user_id/personal_access_tokens/:personal_access_token_id
+DELETE /users/:id/personal_access_tokens/:personal_access_token_id
```
Parameters:
| Attribute | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
-| `user_id` | integer | yes | The ID of the user |
+| `id` | integer | yes | The ID of the user |
| `personal_access_token_id` | integer | yes | The ID of the personal access token |