Diese Version von GitHub Enterprise Server wurde eingestellt am 2024-07-09. Es wird keine Patch-Freigabe vorgenommen, auch nicht für kritische Sicherheitsprobleme. Für bessere Leistung, verbesserte Sicherheit und neue Features aktualisiere auf die neueste Version von GitHub Enterprise Server. Wende dich an den GitHub Enterprise-Support, um Hilfe zum Upgrade zu erhalten.
REST-API-Endpunkte für Banner mit Organisationsankündigungen
Mithilfe der API für Banner mit Organisationsankündigungen kannst du das Ankündigungsbanner für deine Organisation abrufen, festlegen und entfernen.
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.
Parameter für „Get announcement banner for organization“
Name, type, BESCHREIBUNG |
---|
accept string Setting to |
Name, type, BESCHREIBUNG |
---|
org string ErforderlichThe organization name. The name is not case sensitive. |
HTTP-Antwortstatuscodes für „Get announcement banner for organization“
Statuscode | BESCHREIBUNG |
---|---|
200 | OK |
Codebeispiele für „Get announcement banner for organization“
Anforderungsbeispiel
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/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.
Parameter für „Set announcement banner for organization“
Name, type, BESCHREIBUNG |
---|
accept string Setting to |
Name, type, BESCHREIBUNG |
---|
org string ErforderlichThe organization name. The name is not case sensitive. |
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 announcement banner for organization“
Statuscode | BESCHREIBUNG |
---|---|
200 | OK |
Codebeispiele für „Set announcement banner for organization“
Anforderungsbeispiel
curl -L \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/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.
Parameter für „Remove announcement banner from organization“
Name, type, BESCHREIBUNG |
---|
accept string Setting to |
Name, type, BESCHREIBUNG |
---|
org string ErforderlichThe organization name. The name is not case sensitive. |
HTTP-Antwortstatuscodes für „Remove announcement banner from organization“
Statuscode | BESCHREIBUNG |
---|---|
204 | No Content |
Codebeispiele für „Remove announcement banner from organization“
Anforderungsbeispiel
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2022-11-28" \
http(s)://HOSTNAME/api/v3/orgs/ORG/announcement
Response
Status: 204