Skip to main content
REST API はバージョン管理になりました。 詳細については、「API のバージョン管理について」を参照してください。

企業のお知らせバナー用 REST API エンドポイント

Enterprise Announcement Banners API を使って、エンタープライズのお知らせバナーを取得、設定、削除できます。

Get announcement banner for enterprise

Gets the announcement banner currently set for the enterprise.

"Get announcement banner for enterprise" のきめ細かいアクセス トークン

このエンドポイントは、GitHub アプリのユーザー アクセス トークン、GitHub アプリのインストール アクセス トークン、またはきめ細かい個人用アクセス トークンでは機能しません。

"Get announcement banner for enterprise" のパラメーター

ヘッダー
名前, Type, 説明
accept string

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

パス パラメーター
名前, Type, 説明
enterprise string 必須

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

"Get announcement banner for enterprise" の HTTP 応答状態コード

状態コード説明
200

OK

"Get announcement banner for enterprise" のコード サンプル

要求の例

get/enterprises/{enterprise}/announcement
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/enterprises/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 announcement banner for enterprise

Sets the announcement banner to display for the enterprise.

"Set announcement banner for enterprise" のきめ細かいアクセス トークン

このエンドポイントは、GitHub アプリのユーザー アクセス トークン、GitHub アプリのインストール アクセス トークン、またはきめ細かい個人用アクセス トークンでは機能しません。

"Set announcement banner for enterprise" のパラメーター

ヘッダー
名前, Type, 説明
accept string

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

パス パラメーター
名前, Type, 説明
enterprise string 必須

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

本文のパラメーター
名前, Type, 説明
announcement string or null 必須

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 announcement banner for enterprise" の HTTP 応答状態コード

状態コード説明
200

OK

"Set announcement banner for enterprise" のコード サンプル

要求の例

patch/enterprises/{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" \ https://api.github.com/enterprises/ENTERPRISE/announcement \ -d '{"announcement":"Very **important** announcement about _something_.","expires_at":"2021-01-01T00:00:00.000+00:00","user_dismissible":false}'

Announcement banner

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

Remove announcement banner from enterprise

Removes the announcement banner currently set for the enterprise.

"Remove announcement banner from enterprise" のきめ細かいアクセス トークン

このエンドポイントは、GitHub アプリのユーザー アクセス トークン、GitHub アプリのインストール アクセス トークン、またはきめ細かい個人用アクセス トークンでは機能しません。

"Remove announcement banner from enterprise" のパラメーター

ヘッダー
名前, Type, 説明
accept string

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

パス パラメーター
名前, Type, 説明
enterprise string 必須

The slug version of the enterprise name. You can also substitute this value with the enterprise id.

"Remove announcement banner from enterprise" の HTTP 応答状態コード

状態コード説明
204

No Content

"Remove announcement banner from enterprise" のコード サンプル

要求の例

delete/enterprises/{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" \ https://api.github.com/enterprises/ENTERPRISE/announcement

Response

Status: 204