Applications API

Tier: Free, Premium, Ultimate
Offering: GitLab.com, Self-managed, GitLab Dedicated

Applications API는 다음을 위해 인스턴스 전체의 OAuth 애플리케이션에서 작동합니다:

Applications API를 사용하여 그룹 애플리케이션이나 개별 사용자의 애플리케이션을 관리할 수 없습니다.

note
애플리케이션 API는 관리자 사용자만 사용할 수 있습니다.

애플리케이션 만들기

JSON payload를 게시하여 애플리케이션을 만듭니다.

요청이 성공하면 200을 반환합니다.

POST /applications

매개변수:

속성 유형 필수 설명
name string yes 애플리케이션의 이름.
redirect_uri string yes 애플리케이션의 리디렉션 URI.
scopes string yes 애플리케이션의 스코프. 각 스코프는 공백을 이용하여 구분하여 여러 개를 지정할 수 있습니다.
confidential boolean no 애플리케이션은 클라이언트 비밀을 비밀로 유지해야하는 경우 사용됩니다. 네이티브 모바일 앱과 싱글 페이지 앱은 비비밀이라고 간주됩니다. 제공되지 않으면 기본적으로 true로 설정됩니다.

예시 요청:

curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \
     --data "name=MyApplication&redirect_uri=http://redirect.uri&scopes=api read_user email" \
     "https://gitlab.example.com/api/v4/applications"

예시 응답:

{
    "id":1,
    "application_id": "5832fc6e14300a0d962240a8144466eef4ee93ef0d218477e55f11cf12fc3737",
    "application_name": "MyApplication",
    "secret": "ee1dd64b6adc89cf7e2c23099301ccc2c61b441064e9324d963c46902a85ec34",
    "callback_url": "http://redirect.uri",
    "confidential": true
}

모든 애플리케이션 나열

등록된 모든 애플리케이션을 나열합니다.

GET /applications

예시 요청:

curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/applications"

예시 응답:

[
    {
        "id":1,
        "application_id": "5832fc6e14300a0d962240a8144466eef4ee93ef0d218477e55f11cf12fc3737",
        "application_name": "MyApplication",
        "callback_url": "http://redirect.uri",
        "confidential": true
    }
]
note
이 API에서 secret 값은 노출되지 않습니다.

애플리케이션 삭제

특정 애플리케이션을 삭제합니다.

요청이 성공하면 204를 반환합니다.

DELETE /applications/:id

매개변수:

속성 유형 필수 설명
id integer yes 애플리케이션의 ID (application_id가 아님).

예시 요청:

curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/applications/:id"