We've recently moved some of the REST API documentation. If you can't find what you're looking for, you might try the Actions REST API page.
公告
公告 API 允许您管理企业中的全局公告横幅。
公告
公告 API 允许您管理企业中的全局公告横幅。 更多信息请参阅“自定义企业的用户消息”。
Get the global announcement banner
Gets the current message and expiration date of the global announcement banner in your enterprise.
HTTP 响应状态代码
| 状态代码 | 描述 |
|---|---|
200 | OK |
代码示例
curl \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token <TOKEN>" \
http(s)://HOSTNAME/api/v3/enterprise/announcementDefault response
Status: 200{
"announcement": "Very **important** announcement about _nothing_.",
"expires_at": "2021-01-01T00:00:00.000+00:00"
}Set the global announcement banner
Sets the message and expiration time for the global announcement banner in your enterprise.
参数
| 标头 |
|---|
| 名称, 类型, 描述 |
acceptstringSetting to |
| 正文参数 |
| 名称, 类型, 描述 |
announcementstring必选The announcement text in GitHub Flavored Markdown. For more information about GitHub Flavored Markdown, see "Basic writing and formatting syntax." |
expires_atstring or nullThe time at which the announcement expires. This is a timestamp in ISO 8601 format: |
HTTP 响应状态代码
| 状态代码 | 描述 |
|---|---|
200 | OK |
代码示例
curl \
-X PATCH \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token <TOKEN>" \
http(s)://HOSTNAME/api/v3/enterprise/announcementDefault response
Status: 200{
"announcement": "Very **important** announcement about _nothing_.",
"expires_at": "2021-01-01T00:00:00.000+00:00"
}Remove the global announcement banner
代码示例
curl \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token <TOKEN>" \
http(s)://HOSTNAME/api/v3/enterprise/announcementResponse
Status: 204