1
1
# Applications API
2
2
3
- > [ Introduced] [ ce- 8160] in GitLab 10.5
3
+ > [ Introduced] ( https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/ 8160) in GitLab 10.5.
4
4
5
- [ ce-8160 ] : https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/8160
5
+ Applications API operates on OAuth applications for:
6
6
7
- Only admin user can use the Applications API.
7
+ - [ Using GitLab as an authentication provider] ( ../integration/oauth_provider.md ) .
8
+ - [ Allowing access to GitLab resources on a user's behalf] ( oauth2.md ) .
8
9
9
- ## Create a application
10
+ NOTE: ** Note:**
11
+ Only admin users can use the Applications API.
10
12
11
- Create a application by posting a JSON payload.
13
+ ## Create an application
14
+
15
+ Create an application by posting a JSON payload.
12
16
13
17
Returns ` 200 ` if the request succeeds.
14
18
15
- ```
19
+ ``` text
16
20
POST /applications
17
21
```
18
22
19
- | Attribute | Type | Required | Description |
20
- | --------- | ---- | -------- | ----------- |
21
- | ` name ` | string | yes | The name of the application |
22
- | ` redirect_uri ` | string | yes | The redirect URI of the application |
23
- | ` scopes ` | string | yes | The scopes of the application |
23
+ Parameters:
24
+
25
+ | Attribute | Type | Required | Description |
26
+ | :---------------| :-------| :---------| :---------------------------------|
27
+ | ` name ` | string | yes | Name of the application. |
28
+ | ` redirect_uri ` | string | yes | Redirect URI of the application. |
29
+ | ` scopes ` | string | yes | Scopes of the application. |
30
+
31
+ Example request:
24
32
25
- ``` bash
33
+ ``` sh
26
34
curl --request POST --header " PRIVATE-TOKEN: <your_access_token>" --data " name=MyApplication&redirect_uri=http://redirect.uri&scopes=" https://gitlab.example.com/api/v4/applications
27
35
```
28
36
@@ -42,11 +50,13 @@ Example response:
42
50
43
51
List all registered applications.
44
52
45
- ```
53
+ ``` text
46
54
GET /applications
47
55
```
48
56
49
- ``` bash
57
+ Example request:
58
+
59
+ ``` sh
50
60
curl --request GET --header " PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/applications
51
61
```
52
62
@@ -63,22 +73,25 @@ Example response:
63
73
]
64
74
```
65
75
66
- > Note: the ` secret ` value will not be exposed by this API.
76
+ NOTE: ** Note:**
77
+ The ` secret ` value will not be exposed by this API.
67
78
68
79
## Delete an application
69
80
70
81
Delete a specific application.
71
82
72
83
Returns ` 204 ` if the request succeeds.
73
84
74
- ```
85
+ ``` text
75
86
DELETE /applications/:id
76
87
```
77
88
78
89
Parameters:
79
90
80
91
- ` id ` (required) - The id of the application (not the application_id)
81
92
82
- ``` bash
93
+ Example request:
94
+
95
+ ``` sh
83
96
curl --request DELETE --header " PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/applications/:id
84
97
```
0 commit comments