LiveChatBans: delete
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
解除停權狀態,禁止特定使用者參與聊天室,因此使用者可以重新加入該聊天室。API 要求必須獲得頻道擁有者或與停權處分相關的聊天室管理員授權。
常見用途
要求
HTTP 要求
DELETE https://www.googleapis.com/youtube/v3/liveChat/bans
授權
這項要求需要授權,至少擁有下列其中一個範圍。如要進一步瞭解驗證和授權,請參閱實作 OAuth 2.0 驗證。
內容範圍 |
https://www.googleapis.com/auth/youtube |
https://www.googleapis.com/auth/youtube.force-ssl |
參數
下表列出這個查詢支援的參數。這裡列出的所有參數都是查詢參數。
參數 |
必要參數 |
id |
string
id 參數代表要移除的即時通訊停權狀態。這個值可明確識別禁止和即時通訊。 |
回覆
如果成功,這個方法會傳回 HTTP 204 No Content
狀態碼。
錯誤
下表顯示 API 為回應這個方法時,可能會傳回的錯誤訊息。詳情請參閱錯誤訊息。
錯誤類型 |
錯誤詳情 |
說明 |
forbidden (403) |
forbidden |
無法移除指定的停權狀態。如果此要求是由某位管理員授權,他正嘗試移除另一位管理員的停權狀態,就可能發生這項錯誤。 |
forbidden (403) |
insufficientPermissions |
您的權限不足,無法移除指定的停權狀態。 |
invalidValue (400) |
invalidLiveChatBanId |
id 參數指定的值無效。 |
notFound (404) |
liveChatBanNotFound |
找不到指定的停權狀態。 |
試試看!
請使用 APIs Explorer 呼叫這個 API,並查看 API 要求和回應。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-07-11 (世界標準時間)。
[null,null,["上次更新時間:2024-07-11 (世界標準時間)。"],[],[],null,["# LiveChatBans: delete\n\nRemoves a ban that prevents a specific user from contributing to a live chat, thereby enabling the user to rejoin the chat. The API request must be authorized by the channel owner or a moderator of the live chat associated with the ban.\n\nCommon use cases\n----------------\n\nThe list below shows common use cases for this method. Hover over a use case to see its description, or click on a use case to load sample parameter values in the APIs Explorer. You can open the [fullscreen APIs Explorer](#) to see code samples that dynamically update to reflect the parameter values entered in the Explorer.\n\nThe table below shows common use cases for this method. You can click on a use case name to load sample parameter values in the APIs Explorer. Or you can see code samples for a use case in the fullscreen APIs Explorer by clicking on the code icon below a use case name. In the fullscreen UI, you can update parameter and property values and the code samples will dynamically update to reflect the values you enter. \nThis method has one common use case, which is described below. The buttons below the description populate the APIs Explorer with sample values or open the fullscreen APIs Explorer to show code samples that use those values. The code samples also dynamically update if you change the values.\n\n\u003cbr /\u003e\n\nRequest\n-------\n\n### HTTP request\n\n```\nDELETE https://www.googleapis.com/youtube/v3/liveChat/bans\n```\n\n### Authorization\n\nThis request requires authorization with at least one of the following scopes. To read more\nabout authentication and authorization, see [Implementing OAuth 2.0 authentication](/youtube/v3/live/authentication).\n\n| Scope |\n|-----------------------------------------------------|\n| `https://www.googleapis.com/auth/youtube` |\n| `https://www.googleapis.com/auth/youtube.force-ssl` |\n\n### Parameters\n\nThe following table lists the parameters that this query supports. All of the parameters listed are query parameters.\n\n| Parameters ||\n|------|---------------------------------------------------------------------------------------------------------------------------|---|\n| **Required parameters** |||\n| `id` | `string` The **id** parameter identifies the chat ban to remove. The value uniquely identifies both the ban and the chat. |\n\n### Request body\n\nDo not provide a request body when calling this method.\n\nResponse\n--------\n\nIf successful, this method returns an HTTP `204 No Content` status code.\n\nErrors\n------\n\nThe following table identifies error messages that the API could return in response to a call to\nthis method. For more details, see [error message](/youtube/v3/live/docs/errors).\n\n| Error type | Error detail | Description |\n|----------------------|---------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `forbidden (403)` | `forbidden` | The specified ban cannot be removed. This error can occur if the request is authorized by one moderator who is attempting to remove a ban on another moderator. |\n| `forbidden (403)` | `insufficientPermissions` | You do not have the necessary permissions to remove the specified ban. |\n| `invalidValue (400)` | `invalidLiveChatBanId` | The `id` parameter specifies an invalid value. |\n| `notFound (404)` | `liveChatBanNotFound` | The specified ban cannot be found. |\n\nTry it!\n-------\n\nUse the APIs Explorer to call this API and see the API request and response."]]