REST Resource: liveChatBans

資源:LiveChatBan

liveChatBan 資源會識別 YouTube 使用者,以及禁止該使用者參與的 YouTube 直播聊天室。

JSON 表示法
{
  "kind": string,
  "etag": string,
  "id": string,
  "snippet": {
    "liveChatId": string,
    "type": enum,
    "banDurationSeconds": string,
    "bannedUserDetails": {
      "channelId": string,
      "channelUrl": string,
      "displayName": string,
      "profileImageUrl": string
    }
  }
}
欄位
kind

string

僅供輸出。識別這是哪種資源。值:固定字串 "youtube#liveChatBan"。

etag

string

僅供輸出。這項資源的 Etag。

id

string

僅供輸出。YouTube 指派的 ID,用於明確識別禁言。

snippet

object

必填。snippet 物件會識別遭封鎖的使用者,並包含封鎖相關詳細資料。

snippet.liveChatId

string

必填。僅供輸入。要封鎖的聊天室。與直播相關聯的聊天室 ID 會在 liveBroadcast 資源的 snippet.liveChatId 屬性中傳回。

snippet.type

enum

必填。封鎖類型。

這個列舉欄位的有效值如下:

  • permanent
  • temporary
snippet.banDurationSeconds

string

(選填) 僅供輸入。封鎖時間長度 (以秒為單位)。只有在封鎖類型為 temporary 時,才需要為這項屬性設定值;如果是 permanent 封鎖,系統會忽略這項屬性。可接受的值上限為 86400 (24 小時)。預設值為 300 (5 分鐘)。

snippet.bannedUserDetails

object

必填。用於識別遭停權的使用者。在 liveChatBans.insert 要求中,請只設定 channelId,API 會在回應中填入 channelUrl、displayName 和 profileImageUrl。

snippet.bannedUserDetails.channelId

string

YouTube 頻道 ID。

snippet.bannedUserDetails.channelUrl

string

頻道網址。

snippet.bannedUserDetails.displayName

string

頻道的顯示名稱。

snippet.bannedUserDetails.profileImageUrl

string

頻道的顯示圖片網址。

方法

delete

移除永久封鎖,讓特定使用者能重新加入聊天室並發言。

insert

禁止特定使用者參與聊天室。