그룹 및 프로젝트 접근 요청 API
Tier: Free, Premium, Ultimate
Offering: GitLab.com, Self-managed, GitLab Dedicated
유효한 접근 수준
접근 수준은 Gitlab::Access
모듈에 정의되어 있으며, 다음 수준이 인식됩니다:
- 접근 없음 (
0
) - 최소 접근 (
5
) - 게스트 (
10
) - 보고자 (
20
) - 개발자 (
30
) - 유지 관리자 (
40
) - 소유자 (
50
)
그룹 또는 프로젝트에 대한 접근 요청 목록
인증된 사용자가 볼 수 있는 접근 요청 목록을 가져옵니다.
GET /groups/:id/access_requests
GET /projects/:id/access_requests
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
integer/string | 예 | 프로젝트의 ID 또는 URL 인코딩 경로 |
예시 요청:
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/:id/access_requests"
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:id/access_requests"
예시 응답:
[
{
"id": 1,
"username": "raymond_smith",
"name": "Raymond Smith",
"state": "active",
"created_at": "2012-10-22T14:13:35Z",
"requested_at": "2012-10-22T14:13:35Z"
},
{
"id": 2,
"username": "john_doe",
"name": "John Doe",
"state": "active",
"created_at": "2012-10-22T14:13:35Z",
"requested_at": "2012-10-22T14:13:35Z"
}
]
그룹 또는 프로젝트에 접근 요청하기
인증된 사용자가 그룹 또는 프로젝트에 접근 요청을 합니다.
POST /groups/:id/access_requests
POST /projects/:id/access_requests
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
integer/string | 예 | 그룹 또는 프로젝트의 ID 또는 URL 인코딩 경로 |
예시 요청:
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/:id/access_requests"
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:id/access_requests"
예시 응답:
{
"id": 1,
"username": "raymond_smith",
"name": "Raymond Smith",
"state": "active",
"created_at": "2012-10-22T14:13:35Z",
"requested_at": "2012-10-22T14:13:35Z"
}
접근 요청 승인하기
주어진 사용자에 대한 접근 요청을 승인합니다.
PUT /groups/:id/access_requests/:user_id/approve
PUT /projects/:id/access_requests/:user_id/approve
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
integer/string | 예 | 프로젝트의 ID 또는 URL 인코딩 경로 |
user_id |
integer | 예 | 접근 요청자의 사용자 ID |
access_level |
integer | 아니요 | 유효한 접근 수준 (기본값: 30 , 개발자 역할) |
예시 요청:
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/:id/access_requests/:user_id/approve?access_level=20"
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:id/access_requests/:user_id/approve?access_level=20"
예시 응답:
{
"id": 1,
"username": "raymond_smith",
"name": "Raymond Smith",
"state": "active",
"created_at": "2012-10-22T14:13:35Z",
"access_level": 20
}
접근 요청 거부
특정 사용자에 대한 접근 요청을 거부합니다.
DELETE /groups/:id/access_requests/:user_id
DELETE /projects/:id/access_requests/:user_id
속성 | 유형 | 필수 | 설명 |
---|---|---|---|
id |
integer/string | yes | 프로젝트의 ID 또는 URL 인코딩 경로 |
user_id |
integer | yes | 접근 요청자의 사용자 ID |
예시 요청:
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/:id/access_requests/:user_id"
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/:id/access_requests/:user_id"