Skip to main content
Wir veröffentlichen regelmäßig Aktualisierungen unserer Dokumentation, und die Übersetzung dieser Seite ist möglicherweise noch nicht abgeschlossen. Aktuelle Informationen findest du in der englischsprachigen Dokumentation.
GitHub AE ist derzeit begrenzt freigegeben.

Teile der REST-API-Dokumentation wurden kürzlich an andere Stelle verschoben. Falls du nicht findest, wonach du suchst, kannst du die Aktionen-REST-API-Seite ausprobieren.

Ankündigung

Verwende die REST-API, um das globale Ankündigungsbanner in deinem Unternehmen zu verwalten.

Informationen zu Ankündigungen

Du kannst die REST-API verwenden, um das globale Ankündigungsbanner in deinem Unternehmen zu verwalten. Weitere Informationen findest du unter Anpassen von Benutzernachrichten für dein Unternehmen.

Get the global announcement banner

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

HTTP-Antwortstatuscodes für „Get the global announcement banner“

StatuscodeBESCHREIBUNG
200

OK

Codebeispiele für „Get the global announcement banner“

get/enterprise/announcement
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ https://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.

Parameter für „Set the global announcement banner“

Header
Name, type, BESCHREIBUNG
accept string

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

Textparameter
Name, type, BESCHREIBUNG
announcement string or null Erforderlich

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-Antwortstatuscodes für „Set the global announcement banner“

StatuscodeBESCHREIBUNG
200

OK

Codebeispiele für „Set the global announcement banner“

patch/enterprise/announcement
curl -L \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ https://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.

HTTP-Antwortstatuscodes für „Remove the global announcement banner“

StatuscodeBESCHREIBUNG
204

No Content

Codebeispiele für „Remove the global announcement banner“

delete/enterprise/announcement
curl -L \ -X DELETE \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ https://HOSTNAME/api/v3/enterprise/announcement

Response

Status: 204