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“
Statuscode | BESCHREIBUNG |
---|---|
200 | OK |
Codebeispiele für „Get the global announcement banner“
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“
Name, type, BESCHREIBUNG |
---|
accept string Setting to |
Name, type, BESCHREIBUNG |
---|
announcement string or null ErforderlichThe 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: |
HTTP-Antwortstatuscodes für „Set the global announcement banner“
Statuscode | BESCHREIBUNG |
---|---|
200 | OK |
Codebeispiele für „Set the global announcement banner“
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“
Statuscode | BESCHREIBUNG |
---|---|
204 | No Content |
Codebeispiele für „Remove the global announcement banner“
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
https://HOSTNAME/api/v3/enterprise/announcement
Response
Status: 204