브로드캐스트 메시지 API
Tier: Free, Premium, Ultimate
Offering: Self-managed, GitLab Dedicated
브로드캐스트 메시지 API는 브로드캐스트 메시지에서 작동합니다.
GitLab 12.8부터 GET 요청은 인증이 필요하지 않습니다. 다른 모든 브로드캐스트 메시지 API 엔드포인트는 관리자만 접근할 수 있습니다. 다음은 비-GET 요청의 결과입니다:
- 게스트는
401 Unauthorized
가 발생합니다. - 일반 사용자는
403 Forbidden
이 발생합니다.
모든 브로드캐스트 메시지 가져오기
Tier: Free, Premium, Ultimate
Offering: GitLab.com, Self-managed, GitLab Dedicated
모든 브로드캐스트 메시지를 나열합니다.
GET /broadcast_messages
예시 요청:
curl "https://gitlab.example.com/api/v4/broadcast_messages"
예시 응답:
[
{
"message":"예시 브로드캐스트 메시지",
"starts_at":"2016-08-24T23:21:16.078Z",
"ends_at":"2016-08-26T23:21:16.080Z",
"font":"#FFFFFF",
"id":1,
"active": false,
"target_access_levels": [10,30],
"target_path": "*/welcome",
"broadcast_type": "banner",
"dismissable": false
}
]
특정 브로드캐스트 메시지 가져오기
Tier: Free, Premium, Ultimate
Offering: GitLab.com, Self-managed, GitLab Dedicated
특정 브로드캐스트 메시지를 가져옵니다.
GET /broadcast_messages/:id
매개변수:
속성 | 타입 | 필수 | 설명 |
---|---|---|---|
id
| integer | yes | 가져올 브로드캐스트 메시지의 ID. |
예시 요청:
curl "https://gitlab.example.com/api/v4/broadcast_messages/1"
예시 응답:
{
"message":"배포 진행 중",
"starts_at":"2016-08-24T23:21:16.078Z",
"ends_at":"2016-08-26T23:21:16.080Z",
"font":"#FFFFFF",
"id":1,
"active":false,
"target_access_levels": [10,30],
"target_path": "*/welcome",
"broadcast_type": "banner",
"dismissable": false
}
브로드캐스트 메시지 생성하기
새로운 브로드캐스트 메시지를 생성합니다.
POST /broadcast_messages
매개변수:
속성 | 타입 | 필수 | 설명 |
---|---|---|---|
message
| string | yes | 표시할 메시지. |
starts_at
| datetime | no | 시작 시간 (기본값은 UTC의 현재 시간). ISO 8601 형식으로 기대됩니다 (2019-03-15T08:00:00Z ).
|
ends_at
| datetime | no | 종료 시간 (기본값은 UTC의 현재 시간으로부터 1시간). ISO 8601 형식으로 기대됩니다 (2019-03-15T08:00:00Z ).
|
font
| string | no | 전경색 16진수 코드. |
target_access_levels
| 정수 배열 | no | 브로드캐스트 메시지의 대상 액세스 수준(역할). |
target_path
| string | no | 브로드캐스트 메시지의 대상 경로. |
broadcast_type
| string | no | 모습 타입 (기본값은 배너). |
dismissable
| 불리언 | no | 사용자가 메시지를 닫을 수 있는지 여부? |
target_access_levels
은 Gitlab::Access
모듈에서 정의됩니다. 다음 수준이 유효합니다:
- 게스트 (
10
) - 기고자(
20
) - 개발자 (
30
) - 관리자 (
40
) - 소유자 (
50
)
예시 요청:
curl --data "message=배포 진행 중&target_access_levels[]=10&target_access_levels[]=30" \
--header "PRIVATE-TOKEN: <당신의_액세스_토큰>" \
"https://gitlab.example.com/api/v4/broadcast_messages"
예시 응답:
{
"message":"배포 진행 중",
"starts_at":"2016-08-26T00:41:35.060Z",
"ends_at":"2016-08-26T01:41:35.060Z",
"font":"#FFFFFF",
"id":1,
"active": true,
"target_access_levels": [10,30],
"target_path": "*/welcome",
"broadcast_type": "notification",
"dismissable": false
}
브로드캐스트 메시지 업데이트하기
기존의 브로드캐스트 메시지를 업데이트합니다.
PUT /broadcast_messages/:id
매개변수:
속성 | 타입 | 필수 | 설명 |
---|---|---|---|
id
| integer | yes | 업데이트할 브로드캐스트 메시지의 ID. |
message
| string | no | 표시할 메시지. |
starts_at
| datetime | no | 시작 시간 (UTC). ISO 8601 형식으로 기대됩니다 (2019-03-15T08:00:00Z ).
|
ends_at
| datetime | no | 종료 시간 (UTC). ISO 8601 형식으로 기대됩니다 (2019-03-15T08:00:00Z ).
|
font
| string | no | 전경색 16진수 코드. |
target_access_levels
| 정수 배열 | no | 브로드캐스트 메시지의 대상 액세스 수준(역할). |
target_path
| string | no | 브로드캐스트 메시지의 대상 경로. |
broadcast_type
| string | no | 모습 타입 (기본값은 배너). |
dismissable
| 불리언 | no | 사용자가 메시지를 닫을 수 있는지 여부? |
target_access_levels
은 Gitlab::Access
모듈에서 정의됩니다. 다음 수준이 유효합니다:
- 게스트 (
10
) - 기고자 (
20
) - 개발자 (
30
) - 관리자 (
40
) - 소유자 (
50
)
예시 요청:
curl --request PUT --data "message=메시지 업데이트" \
--header "PRIVATE-TOKEN: <당신의_액세스_토큰>" "https://gitlab.example.com/api/v4/broadcast_messages/1"
예시 응답:
{
"message":"메시지 업데이트",
"starts_at":"2016-08-26T00:41:35.060Z",
"ends_at":"2016-08-26T01:41:35.060Z",
"font":"#FFFFFF",
"id":1,
"active": true,
"target_access_levels": [10,30],
"target_path": "*/welcome",
"broadcast_type": "notification",
"dismissable": false
}
방송 메시지 삭제
방송 메시지를 삭제합니다.
DELETE /broadcast_messages/:id
매개변수:
속성 | 유형 | 필요 여부 | 설명 |
---|---|---|---|
id
| 정수 | 예 | 삭제할 방송 메시지의 ID. |
예시 요청:
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/broadcast_messages/1"