Баннеры объявлений enterprise
API "Корпоративные баннеры объявлений" позволяет получать, настраивать и удалять баннеры объявлений для вашего предприятия.
Get announcement banner for enterprise
Gets the announcement banner currently set for the enterprise.
Параметры для "Get announcement banner for enterprise"
Заголовки |
---|
Имя, Тип, Описание |
accept string Setting to |
Параметры пути |
Имя, Тип, Описание |
enterprise string ОбязательноThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
Коды состояния HTTP-ответа для "Get announcement banner for enterprise"
Код состояния | Описание |
---|---|
200 | OK |
Примеры кода для "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.
Параметры для "Set announcement banner for enterprise"
Заголовки |
---|
Имя, Тип, Описание |
accept string Setting to |
Параметры пути |
Имя, Тип, Описание |
enterprise string ОбязательноThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
Параметры запроса |
Имя, Тип, Описание |
announcement string or null Обязательно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: |
Коды состояния HTTP-ответа для "Set announcement banner for enterprise"
Код состояния | Описание |
---|---|
200 | OK |
Примеры кода для "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.
Параметры для "Remove announcement banner from enterprise"
Заголовки |
---|
Имя, Тип, Описание |
accept string Setting to |
Параметры пути |
Имя, Тип, Описание |
enterprise string ОбязательноThe slug version of the enterprise name. You can also substitute this value with the enterprise id. |
Коды состояния HTTP-ответа для "Remove announcement banner from enterprise"
Код состояния | Описание |
---|---|
204 | No Content |
Примеры кода для "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