Applications API

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

애플리케이션 생성

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"

애플리케이션 시크릿 갱신

애플리케이션 시크릿을 갱신합니다. 요청이 성공하면 200을 반환합니다.

POST /applications/:id/renew-secret

지원되는 속성:

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

예시 요청:

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

예시 응답:

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