Skip to main content
O controle de versão da API REST já foi feito. Para obter mais informações, confira "Sobre o controle de versão da API".

Pontos de extremidade da API REST para banners de comunicados corporativos

A API de Faixas de Anúncio de Empresa permite obter, definir e remover a faixa de anúncio de sua empresa.

Get announcement banner for enterprise

Gets the announcement banner currently set for the enterprise.

Tokens de acesso refinados para "Get announcement banner for enterprise"

Esse ponto de extremidade não funciona com tokens de acesso de usuário do aplicativo GitHub, tokens de acesso de instalação do aplicativo GitHub ou tokens de acesso pessoal refinados.

Parâmetros para "Get announcement banner for enterprise"

Cabeçalhos
Nome, Tipo, Descrição
accept string

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

Parâmetros de caminho
Nome, Tipo, Descrição
enterprise string Obrigatório

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

Códigos de status de resposta HTTP para "Get announcement banner for enterprise"

Código de statusDescrição
200

OK

Exemplos de código para "Get announcement banner for enterprise"

Exemplo de solicitação

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.

Tokens de acesso refinados para "Set announcement banner for enterprise"

Esse ponto de extremidade não funciona com tokens de acesso de usuário do aplicativo GitHub, tokens de acesso de instalação do aplicativo GitHub ou tokens de acesso pessoal refinados.

Parâmetros para "Set announcement banner for enterprise"

Cabeçalhos
Nome, Tipo, Descrição
accept string

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

Parâmetros de caminho
Nome, Tipo, Descrição
enterprise string Obrigatório

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

Parâmetros do corpo
Nome, Tipo, Descrição
announcement string or null Obrigatório

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.

Códigos de status de resposta HTTP para "Set announcement banner for enterprise"

Código de statusDescrição
200

OK

Exemplos de código para "Set announcement banner for enterprise"

Exemplo de solicitação

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.

Tokens de acesso refinados para "Remove announcement banner from enterprise"

Esse ponto de extremidade não funciona com tokens de acesso de usuário do aplicativo GitHub, tokens de acesso de instalação do aplicativo GitHub ou tokens de acesso pessoal refinados.

Parâmetros para "Remove announcement banner from enterprise"

Cabeçalhos
Nome, Tipo, Descrição
accept string

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

Parâmetros de caminho
Nome, Tipo, Descrição
enterprise string Obrigatório

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

Códigos de status de resposta HTTP para "Remove announcement banner from enterprise"

Código de statusDescrição
204

No Content

Exemplos de código para "Remove announcement banner from enterprise"

Exemplo de solicitação

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