LiveChatBans

liveChatBan 資源會標示 YouTube 使用者,以及該使用者遭禁止參與的 YouTube 聊天室。

方法

這個 API 支援 liveChatBans 資源的下列方法:

插入
禁止特定使用者參與聊天室。API 要求必須由頻道擁有者或與停權相關的直播聊天室管理員授權。 立即試用
刪除
移除禁止特定使用者參與聊天室的禁令,讓使用者能夠重新加入聊天室。API 要求必須由頻道擁有者或與停權相關的直播聊天室管理員授權。 立即試用

資源表示法

以下 JSON 結構顯示 liveChatBans 資源的格式:

{
  "kind": "youtube#liveChatBan",
  "etag": etag,
  "id": string,
  "snippet": {
    "liveChatId": string,
    "type": string,
    "banDurationSeconds": unsigned long,
    "bannedUserDetails": {
      "channelId": string
    }
  }
}

屬性

下表定義了這個資源中顯示的屬性:

屬性
kind string
識別 API 資源的類型。值為 youtube#liveChatBan
etag etag
這項資源的 Etag。
id string
YouTube 指派的 ID,用於唯一識別封鎖。
snippet object
snippet 物件會識別遭到封鎖的使用者,並包含封鎖的詳細資料。
snippet.liveChatId string
遭到封鎖的聊天室。與廣播活動相關聯的即時通訊 ID 會在 liveBroadcast 資源的 snippet.liveChatId 屬性中傳回。
snippet.type string
封鎖類型。

這個屬性的有效值如下:
  • permanent
  • temporary
snippet.banDurationSeconds unsigned long
停權時間長度。只有在禁止內容類型為 temporary 時,才需要為這個屬性設定值。預設值為 300 (5 分鐘)。
snippet.bannedUserDetails object
此物件包含遭到封鎖使用者的識別資訊。
snippet.bannedUserDetails.channelId string
遭停權使用者的 YouTube 頻道 ID。