Skip to main content
이제 REST API의 버전이 지정되었습니다. 자세한 내용은 "API 버전 관리 정보"를 참조하세요.

글로벌 알림에 대한 REST API 엔드포인트

REST API를 사용하rh 엔터프라이즈에서 전체 공지 배너를 관리합니다.

공지 정보

REST API를 사용하여 엔터프라이즈에서 전체 공지 배너를 관리할 수 있습니다. 자세한 내용은 "엔터프라이즈에 대한 사용자 메시지 사용자 지정"을(를) 참조하세요.

이러한 엔드포인트는 personal access token (classic)을(를) 사용하는 인증만 지원합니다. 자세한 내용은 "개인용 액세스 토큰 관리"을 참조하세요.

Get the global announcement banner

Gets the current message and expiration date of the global announcement banner in your enterprise.

"Get the global announcement banner"에 대한 세분화된 액세스 토큰

이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.

"Get the global announcement banner"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

OK

"Get the global announcement banner"에 대한 코드 샘플

요청 예제

get/enterprise/announcement
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ http(s)://HOSTNAME/api/v3/enterprise/announcement

Announcement banner

Status: 200
{ "announcement": "Very **important** announcement about _something_.", "expires_at": "2021-01-01T00:00:00.000+00:00", "user_dismissible": false }

Set the global announcement banner

Sets the message and expiration time for the global announcement banner in your enterprise.

"Set the global announcement banner"에 대한 세분화된 액세스 토큰

이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.

"Set the global announcement banner"에 대한 매개 변수

헤더
이름, Type, 설명
accept string

Setting to application/vnd.github+json is recommended.

본문 매개 변수
이름, Type, 설명
announcement string or null Required

The announcement text in GitHub Flavored Markdown. For more information about GitHub Flavored Markdown, see "Basic writing and formatting syntax."

expires_at string or null

The time at which the announcement expires. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. To set an announcement that never expires, omit this parameter, set it to null, or set it to an empty string.

"Set the global announcement banner"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

OK

"Set the global announcement banner"에 대한 코드 샘플

요청 예제

patch/enterprise/announcement
curl -L \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ http(s)://HOSTNAME/api/v3/enterprise/announcement \ -d '{"announcement":"Very **important** announcement about _something_.","expires_at":"2021-01-01T00:00:00.000+00:00"}'

Announcement banner

Status: 200
{ "announcement": "Very **important** announcement about _something_.", "expires_at": "2021-01-01T00:00:00.000+00:00", "user_dismissible": false }

Remove the global announcement banner

Removes the global announcement banner in your enterprise.

"Remove the global announcement banner"에 대한 세분화된 액세스 토큰

이 엔드포인트는 GitHub 앱 사용자 액세스 토큰, GitHub 앱 설치 액세스 토큰 또는 세분화된 개인용 액세스 토큰에서 작동하지 않습니다.

"Remove the global announcement banner"에 대한 HTTP 응답 상태 코드

상태 코드설명
204

No Content

"Remove the global announcement banner"에 대한 코드 샘플

요청 예제

delete/enterprise/announcement
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ http(s)://HOSTNAME/api/v3/enterprise/announcement

Response

Status: 204