Skip to main content
REST API теперь версия. Дополнительные сведения см. в разделе "О управлении версиями API".

Конечные точки REST API для баннеров объявлений организации

API объявлений организации позволяет получить, задать и удалить баннер объявления для вашей организации.

Get announcement banner for organization

Gets the announcement banner currently set for the organization. Only returns the announcement banner set at the organization level. Organization members may also see an enterprise-level announcement banner. To get an announcement banner displayed at the enterprise level, use the enterprise-level endpoint.

Подробные маркеры доступа для "Get announcement banner for organization

This endpoint works with the following fine-grained token types:

Маркер должен иметь следующий набор разрешений.:

  • "Organization announcement banners" organization permissions (read)

Параметры для "Get announcement banner for organization"

Заголовки
Имя., Тип, Description
accept string

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

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

Коды состояния http-ответа для "Get announcement banner for organization"

Код состоянияОписание
200

OK

Примеры кода для "Get announcement banner for organization"

Пример запроса

get/orgs/{org}/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/orgs/ORG/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 organization

Sets the announcement banner to display for the organization.

Подробные маркеры доступа для "Set announcement banner for organization

This endpoint works with the following fine-grained token types:

Маркер должен иметь следующий набор разрешений.:

  • "Organization announcement banners" organization permissions (write)

Параметры для "Set announcement banner for organization"

Заголовки
Имя., Тип, Description
accept string

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

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

Параметры запроса
Имя., Тип, Description
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.

Коды состояния http-ответа для "Set announcement banner for organization"

Код состоянияОписание
200

OK

Примеры кода для "Set announcement banner for organization"

Пример запроса

patch/orgs/{org}/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/orgs/ORG/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 organization

Removes the announcement banner currently set for the organization.

Подробные маркеры доступа для "Remove announcement banner from organization

This endpoint works with the following fine-grained token types:

Маркер должен иметь следующий набор разрешений.:

  • "Organization announcement banners" organization permissions (write)

Параметры для "Remove announcement banner from organization"

Заголовки
Имя., Тип, Description
accept string

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

Параметры пути
Имя., Тип, Description
org string Обязательное поле

The organization name. The name is not case sensitive.

Коды состояния http-ответа для "Remove announcement banner from organization"

Код состоянияОписание
204

No Content

Примеры кода для "Remove announcement banner from organization"

Пример запроса

delete/orgs/{org}/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/orgs/ORG/announcement

Response

Status: 204