<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # Broadcast Messages API > 原文:[https://docs.gitlab.com/ee/api/broadcast_messages.html](https://docs.gitlab.com/ee/api/broadcast_messages.html) * [Get all broadcast messages](#get-all-broadcast-messages) * [Get a specific broadcast message](#get-a-specific-broadcast-message) * [Create a broadcast message](#create-a-broadcast-message) * [Update a broadcast message](#update-a-broadcast-message) * [Delete a broadcast message](#delete-a-broadcast-message) # Broadcast Messages API[](#broadcast-messages-api "Permalink") 在 GitLab 8.12 中引入. 廣播消息 API 對[廣播消息進行操作](../user/admin_area/broadcast_messages.html) . 從 GitLab 12.8 開始,GET 請求不需要身份驗證. 所有其他廣播消息 API 終結點只能由管理員訪問. 非 GET 請求者: * 來賓將導致`401 Unauthorized` . * 普通用戶將導致`403 Forbidden` . ## Get all broadcast messages[](#get-all-broadcast-messages "Permalink") 列出所有廣播消息. ``` GET /broadcast_messages ``` 請求示例: ``` curl "https://gitlab.example.com/api/v4/broadcast_messages" ``` 響應示例: ``` [ { "message":"Example broadcast message", "starts_at":"2016-08-24T23:21:16.078Z", "ends_at":"2016-08-26T23:21:16.080Z", "color":"#E75E40", "font":"#FFFFFF", "id":1, "active": false, "target_path": "*/welcome", "broadcast_type": "banner", "dismissable": false } ] ``` ## Get a specific broadcast message[](#get-a-specific-broadcast-message "Permalink") 獲取特定的廣播消息. ``` GET /broadcast_messages/:id ``` Parameters: | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer | yes | 要檢索的廣播消息的 ID. | 請求示例: ``` curl "https://gitlab.example.com/api/v4/broadcast_messages/1" ``` 響應示例: ``` { "message":"Deploy in progress", "starts_at":"2016-08-24T23:21:16.078Z", "ends_at":"2016-08-26T23:21:16.080Z", "color":"#cecece", "font":"#FFFFFF", "id":1, "active":false, "target_path": "*/welcome", "broadcast_type": "banner", "dismissable": false } ``` ## Create a broadcast message[](#create-a-broadcast-message "Permalink") 創建一個新的廣播消息. ``` POST /broadcast_messages ``` Parameters: | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `message` | string | yes | 顯示的消息. | | `starts_at` | datetime | no | 開始時間(默認為當前時間). | | `ends_at` | datetime | no | 結束時間(默認為當前時間的一小時). | | `color` | string | no | 背景色十六進制代碼. | | `font` | string | no | 前景顏色十六進制代碼. | | `target_path` | string | no | 廣播消息的目標路徑. | | `broadcast_type` | string | no | 外觀類型(默認為橫幅) | | `dismissable` | boolean | no | 用戶可以關閉該消息嗎? | 請求示例: ``` curl --data "message=Deploy in progress&color=#cecece" --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/broadcast_messages" ``` 響應示例: ``` { "message":"Deploy in progress", "starts_at":"2016-08-26T00:41:35.060Z", "ends_at":"2016-08-26T01:41:35.060Z", "color":"#cecece", "font":"#FFFFFF", "id":1, "active": true, "target_path": "*/welcome", "broadcast_type": "notification", "dismissable": false } ``` ## Update a broadcast message[](#update-a-broadcast-message "Permalink") 更新現有的廣播消息. ``` PUT /broadcast_messages/:id ``` Parameters: | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer | yes | 要更新的廣播消息的 ID. | | `message` | string | no | 顯示的消息. | | `starts_at` | datetime | no | 起始時間. | | `ends_at` | datetime | no | 結束時間. | | `color` | string | no | 背景色十六進制代碼. | | `font` | string | no | 前景顏色十六進制代碼. | | `target_path` | string | no | 廣播消息的目標路徑. | | `broadcast_type` | string | no | 外觀類型(默認為橫幅) | | `dismissable` | boolean | no | 用戶可以關閉該消息嗎? | 請求示例: ``` curl --request PUT --data "message=Update message&color=#000" --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/broadcast_messages/1" ``` 響應示例: ``` { "message":"Update message", "starts_at":"2016-08-26T00:41:35.060Z", "ends_at":"2016-08-26T01:41:35.060Z", "color":"#000", "font":"#FFFFFF", "id":1, "active": true, "target_path": "*/welcome", "broadcast_type": "notification", "dismissable": false } ``` ## Delete a broadcast message[](#delete-a-broadcast-message "Permalink") 刪除廣播消息. ``` DELETE /broadcast_messages/:id ``` Parameters: | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer | yes | 要刪除的廣播消息的 ID. | 請求示例: ``` curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/broadcast_messages/1" ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看