Skip to main content
L’API REST est maintenant versionnée. Pour plus d’informations, consultez « À propos des versions de l’API ».

Points de terminaison d’API REST pour les bannières d’annonces d’organisation

L’API Bannières d’annonce de l’organisation vous permet d’obtenir, de définir et de supprimer la bannière d’annonce pour votre organisation.

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.

Jetons d’accès affinés pour « Get announcement banner for organization »

Ce point de terminaison fonctionne avec les types de jetons suivants:

Le jeton doit avoir l’ensemble d’autorisations suivant:

  • organization_announcement_banners:read

Paramètres pour « Get announcement banner for organization »

En-têtes
Nom, Type, Description
accept string

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

Paramètres de chemin d’accès
Nom, Type, Description
org string Obligatoire

The organization name. The name is not case sensitive.

Codes d’état de la réponse HTTP pour « Get announcement banner for organization »

Code d’étatDescription
200

OK

Exemples de code pour « Get announcement banner for organization »

Exemple de requête

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.

Jetons d’accès affinés pour « Set announcement banner for organization »

Ce point de terminaison fonctionne avec les types de jetons suivants:

Le jeton doit avoir l’ensemble d’autorisations suivant:

  • organization_announcement_banners:write

Paramètres pour « Set announcement banner for organization »

En-têtes
Nom, Type, Description
accept string

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

Paramètres de chemin d’accès
Nom, Type, Description
org string Obligatoire

The organization name. The name is not case sensitive.

Paramètres du corps
Nom, Type, Description
announcement string or null Obligatoire

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.

Codes d’état de la réponse HTTP pour « Set announcement banner for organization »

Code d’étatDescription
200

OK

Exemples de code pour « Set announcement banner for organization »

Exemple de requête

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.

Jetons d’accès affinés pour « Remove announcement banner from organization »

Ce point de terminaison fonctionne avec les types de jetons suivants:

Le jeton doit avoir l’ensemble d’autorisations suivant:

  • organization_announcement_banners:write

Paramètres pour « Remove announcement banner from organization »

En-têtes
Nom, Type, Description
accept string

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

Paramètres de chemin d’accès
Nom, Type, Description
org string Obligatoire

The organization name. The name is not case sensitive.

Codes d’état de la réponse HTTP pour « Remove announcement banner from organization »

Code d’étatDescription
204

No Content

Exemples de code pour « Remove announcement banner from organization »

Exemple de requête

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