LiveChatBans: delete
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ยกเลิกการแบนที่ป้องกันไม่ให้ผู้ใช้บางรายมีส่วนร่วมในแชทสด ซึ่งจะทำให้ผู้ใช้กลับมาเข้าร่วมแชทได้ คำขอ API จะต้องได้รับอนุญาตจากเจ้าของช่องหรือผู้ดูแลแชทสดที่เชื่อมโยงกับการแบน
กรณีการใช้งานทั่วไป
ส่งคำขอ
คำขอ HTTP
DELETE https://www.googleapis.com/youtube/v3/liveChat/bans
การให้สิทธิ์
คำขอนี้ต้องได้รับการให้สิทธิ์ที่มีขอบเขตต่อไปนี้อย่างน้อย 1 ขอบเขต หากต้องการอ่านเพิ่มเติมเกี่ยวกับการตรวจสอบสิทธิ์และการให้สิทธิ์ โปรดดูที่การใช้การตรวจสอบสิทธิ์ 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 และการตอบกลับ
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-07-11 UTC
[null,null,["อัปเดตล่าสุด 2024-07-11 UTC"],[],[],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."]]