Bannières d’annonce d’entreprise
L’API Bannières d’annonce d’entreprise vous permet d’obtenir, de définir et de supprimer la bannière d’annonce pour votre entreprise.
Get announcement banner for enterprise
Gets the announcement banner currently set for the enterprise.
Paramètres pour « Get announcement banner for enterprise »
En-têtes |
---|
Nom, Type, Description |
accept string Setting to |
Paramètres de chemin d’accès |
Nom, Type, Description |
enterprise string ObligatoireThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
Codes d’état de la réponse HTTP pour « Get announcement banner for enterprise »
Code d’état | Description |
---|---|
200 | OK |
Exemples de code pour « Get announcement banner for enterprise »
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.
Paramètres pour « Set announcement banner for enterprise »
En-têtes |
---|
Nom, Type, Description |
accept string Setting to |
Paramètres de chemin d’accès |
Nom, Type, Description |
enterprise string ObligatoireThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
Paramètres du corps |
Nom, Type, Description |
announcement string or null ObligatoireThe 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: |
Codes d’état de la réponse HTTP pour « Set announcement banner for enterprise »
Code d’état | Description |
---|---|
200 | OK |
Exemples de code pour « Set announcement banner for enterprise »
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.
Paramètres pour « Remove announcement banner from enterprise »
En-têtes |
---|
Nom, Type, Description |
accept string Setting to |
Paramètres de chemin d’accès |
Nom, Type, Description |
enterprise string ObligatoireThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
Codes d’état de la réponse HTTP pour « Remove announcement banner from enterprise »
Code d’état | Description |
---|---|
204 | No Content |
Exemples de code pour « Remove announcement banner from enterprise »
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